def bound_value(value: int, minimum: int=0, maximum: int=9) -> int:
    """
    Bounds a value between an upper and lower bound

    :param value: the value to bound
    :param minimum: the minimal allowed value
    :param maximum: the maximal allowed value
    :return: the bounded value
    """
    return minimum if value < minimum else maximum if value > maximum else value