Factorial of any number is multiplication of all 1,2,3,4,.... upto that number.
Example -
5!=1*2*3*4*5
4!=1*2*3*4
Recursion-
Function call itself is called recursion.
stack is use to implement the recursion
print("Enter number")
n=int(input())
def func(n):
if n==1:
return 1
return n*func(n-1)
ans=func(n)
print("Factorial is - "+str(ans))
Enter number
6
Factorial is - 720