def factorial(num):
    """
    Returns the factorial of the input number. Factorial of a number less than or equals to 1 will be returned as 1
    """
    if num < 1:
        print('Input must be >= 1')
    f = 1
    while num > 1:
        f = f * num
        num = num - 1
    return f
