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)