Python program to calculate the factorial of a number


Topic: Python program to calculate the factorial of a number

Solution

def factorial(n):
    if n == 0:
        return 1
    else:
        return n * factorial(n - 1)
n = 45
print(factorial(n))



List all Python Programs