This is a Python Program to find the factorial of a number using recursion.

The program takes a number and determines the factorial of the number using recursion.

1. Take a number from the user and store it in a variable.

2. Pass the number as an argument to a recursive factorial function.

3. Define the base condition as the number to be lesser than or equal to 1 and return 1 if it is.

4. Otherwise call the function recursively with the number minus 1 multiplied by the number itself.

5. Then return the result and print the factorial of the number.

6. Exit.

Here is source code of the Python Program to find the factorial of a number using recursion. The program output is also shown below.

def factorial(n): if(n <= 1): return 1 else: return(n*factorial(n-1)) n = int(input("Enter number:")) print("Factorial:") print(factorial(n))

1. User must enter a number and store it in a variable.

2. The number is passed as an argument to a recursive factorial function.

3. The base condition is that the number has to be lesser than or equal to 1 and return 1 if it is.

4. Otherwise the function is called recursively with the number minus 1 multiplied by the number itself.

5. The result is returned and the factorial of the number is printed.

Case 1: Enter number:5 Factorial: 120 Case 2: Enter number:9 Factorial: 362880

**Sanfoundry Global Education & Learning Series – Python Programs.**

To practice all Python programs, __here is complete set of 150+ Python Problems and Solutions__.