user
Construct a suitable python program to calculate the factorial of a number
num = 4

Response:
assistant
def factorial(num):
    fact = 1
    
    for i in range (1, num+1):
        fact = fact * i
    
    return fact

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