def get_int_from_user(message, min_, max_) -> int:
    """
    Return an integer in range [a, b] (both included) input by user.
    """
    error_msg = 'invalid input, try again'
    while True:
        print(message)
        inp = input(f' ({min_}-{max_})>')
        try:
            inp = int(inp)
        except ValueError:
            print(error_msg)
            continue
        if min_ <= inp <= max_:
            return inp
        else:
            print(error_msg)