def load_integer_from_inclusive_range(name: str, lower: int, upper: int) -> int:
    """Loads integer from range `[lower, upper]`.

    Repeats requests until user enters a correct number.
    Uses range `[lower, inf)` if `upper < lower`.

    Args:
        name (str): name of parameter to load, used for prompts
        lower (int): lower bound, inclusive
        upper (int): upper bound, inclusive

    Returns:
        int: loaded integer
    """

    while True:
        print(f"{name} = ", end="")

        try:
            i = int(input())
        except ValueError:
            print("Please enter an integer")
            continue

        if i < lower:
            print(f"'{name}' must be greater than {lower - 1}")
        elif upper >= lower and i > upper:
            print(f"'{name}' must be less than {upper + 1}")
        else:
            return i