def execcode():
    LOC = """
def factorial(num):
    fact = 1
    for i in range(1, num+1):
        fact = fact * i
    return fact
print(factorial(5))
    """
    exec(LOC)


execcode()

def execcode():
    LOC = """
def factorial(num):
    fact = 1
    for i in range(1, num+1):
        fact = fact * i
    return fact
print(factorial(5))
    """
    exec(LOC)


execcode()

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