Python Forum

Full Version: How recursion function is applied?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What is recursion function in python? can anyone explain it with example?
In python, when a function makes a call to itself, it is termed recursion. But then, in order for it to avoid forming an infinite loop, we must have a base condition. Let’s take an example.
>>> def facto(n):
if n==1: return 1
return n*facto(n-1)
>>> facto(4)