def calculate_factorial(num):
factorial = 1
if num < 0:
print("Factorial does not exist for negative numbers.")
else:
for i in range(1, num + 1):
factorial *= i
print(f"The factorial of {num} is {factorial}")
# Example usage:
number = int(input("Enter a number to calculate factorial: "))
calculate_factorial(number)
To embed this project on your website, copy the following code and paste it into your website's HTML: