1def factorial(n):
2 fact = 1
3 for num in range(2, n + 1):
4 fact = fact * num
5 return(fact)
1def factorial(n):
2 if n == 0:
3 return 1
4 else:
5 return n * factorial(n-1)
6n=int(input("Input a number to compute the factiorial : "))
7print(factorial(n))
8
9