def factorial(n):
    if n == 0 or n == 1:
        return 1
    else:
        return n * factorial(n - 1)

# Taking user input
num = int(input("Enter a number: "))
print(f"Factorial of {num} is {factorial(num)}")

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: