10 Program to calculate factorial of a number using python

Program:

num = int(input("Enter any number:"))
fact = 1
for i in range(0,num):
    fact = (fact * i) + fact

print(fact)


Output:

calculate factorial of a number using python

Previous
Next Post »