Python Program to Find Factorial of the Number Using Recursion
# Find Factorial of the Number in Python Using Recursion # recursive function to calculate number factorial def getFact(n): return n if (n==1) else n * getFact(n - 1); num = 5 # print output print("Factorial of",num,"is",getFact(num))
Output:
Enter any number: 5
Factorial is 120