Find the Factorial of a Number Program in Python

Find the Factorial of a Number Program in Python



Code:

num = 5
fac = 1
for i in range(1, num+1):
    fac = fac * i
print("the factorial of " , num , "is" , fac )






Output:


the factorial of  5 is 120
>>> 

Video Tutorial:





Post a Comment

Previous Post Next Post