Write a function which can compute the factorial of a given numbers.


Topic: Write a function which can compute the factorial of a given numbers.

Solution

def fact(x):
    if x == 0:
        return 1
    return x * fact(x - 1)
x=int(input())
print(fact(x))



List all Python Programs