def factorial2(num):
    """
    return factorial without recursion

    :param num: the number
    :return: factorial
    """
    product = 1
    for n in range(2, num + 1):
        product *= n

    return product