Answers for "Write a program to read a number and print its factorial values"

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 read a number and print its factorial values"

Python Answers by Framework

Browse Popular Code Answers by Language