def repeat(func, num: int = 1, *args, **kwargs):
    """
    Repeats execution of the function consecutively,
    as many times as specified and returns the result
    of the last run.

    :param func: the decorated function
    :param num: the number of times to run the function
    :param args: the positional args of the function
    :param kwargs: the keyword args of the function
    :return: the function return value of the last time the
        function was run
    """
    result = None
    for _ in range(num):
        result = func(*args, **kwargs)
    return result