Answers for "Write a program to calculate factorial of a number. in python"

5

factorial in python

def factorial(n):
    if n == 0:
        return 1
    else:
        return n * factorial(n-1)
n=int(input("Input a number to compute the factiorial : "))
print(factorial(n))
Posted by: Guest on November-23-2020

Code answers related to "Write a program to calculate factorial of a number. in python"

Python Answers by Framework

Browse Popular Code Answers by Language