Search this website

Factorial using recursion in python

No comments
Simple function to calculate factorial of number  using recursion in python 

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

No comments :

Post a Comment