def calculate_sum(n):
return (n * (n + 1)) // 2
# Example usage:
num = int(input("Enter a number 'n' to calculate the sum of first 'n' numbers: "))
result = calculate_sum(num)
print(f"The sum of first {num} numbers is: {result}")
To embed this project on your website, copy the following code and paste it into your website's HTML: