Write a function that generates Factorial of number


Topic: Write a function that generates Factorial of number

Solution

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



List all Python Programs