Write a Python program to print the factorial of a number.
5
def factorial(n):
    if n == 0:
        return 1
    else:
        return n * factorial(n-1)

num = 5
print("The factorial of", num, "is", factorial(num))