factorial in python

Posted by Paidboom - 8 months ago

factorial in python : Python Program to Find the Factorial of a Number

given_num = 6
fact_num = 1
if given_num < 0:
    print("sorry, factorial of a number is not exist of the negative numbers.")
elif given_num == 0:
    print("Your input number is 0 or 1 for factorial")
else:
    for i in range(1, given_num + 1):
        fact_num = fact_num*i
        print("the factorial of ", given_num , "is", fact_num )