Write a function to calculate factorial of number


Topic: Write a function to calculate factorial of number

Solution

def factorial(num):
    if num == 0:
        return 1
    return num * factorial(num - 1)



List all Python Programs