# Python Recursion Function

In this tutorial, we will learn about the  recursion function and create a recursive function in python that can call itself. ## What is the Recursion Function in Python?

Recursion in python is a process by which a function calls itself directly or indirectly.

Recursion is a common mathematical and programming concept. It means that a function calls itself. This has the benefit of meaning that you can loop through data to reach a result. The Python recursion function is also known as python recursive function

Syntax of recursion function.

def function_name():
.
.
.
.
function_name()

Let see an example of the python recursion function.

Example of python recursion example:

def factorial(n):
if n==1:
print(n)
return 1
else:
print(n,‘*’, end = ‘ ‘)
return n* factorial(n-1)
print(factorial(10))

When we execute the above program, we will get the following output.

Output:

10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1
3628800

When the factorial function is called with 10 as an argument, successive calls to the same function are placed while reducing 10. Functions start returning to their earlier call after the argument reaches 1. The return value of the first call is a cumulative product of the return values of all calls.