examples of recursion methods in python
All Contributions
python program to implement recursion for factorial of a number, that demonstrates a user-defined function and return a statement using functions
---------------
def factorial(n):
if n==1:
return 1
else:
return n*factorial(n-1)
print(factorial(5))
total contributions (2)
this is an example of infinite loop using recursion function: