Function recursive Demo : Function Recursive « Function « Python






Function recursive Demo

Function recursive Demo

def factorial(n):
    if n == 1:
        return 1
    else:
        return n * factorial(n-1)


print factorial(10)
           
       








Related examples in the same category

1.Recursive definition of function factorialRecursive definition of function factorial
2.Recursive fibonacci function.Recursive fibonacci function.