def factorial(x):
 if (x==1):
    return 1
 else:
    return(x*factorial (x-1))
num=5
print ("the 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: