Python program to print factorial


Factorial

factorial is the product of integer and all integers below it and it is denoted by "!".
for example:- 5!=120
i.e 5!=5x4x3x2x1

Code

num=int(input("Enter a number to find it's factorial:"))
fact=1
for i in range(1,num+1): 
    fact=fact*i 
print(num,"factorial is =",fact)


Output


Previous
Next Post »