Recursion : Recursive function : Function PYTHON TUTORIALS


PYTHON TUTORIALS » Function » Recursive function »

 

Recursion


def factorial(n):
    if n == or n == 1: # 0! = 1! = 1
        return 1
    else:
        return (n * factorial(n-1))



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Function
» Recursive function