def get_integer(message, minimum, maximum):
    """Retrieves an integer value prompted from console,
       in such a way that `minimum ≤ value ≤ maximum`
    """
    while True:
        try:
            value = int(input(message))
            if not minimum <= value <= maximum:
                raise ValueError()

            return value
        except ValueError:
            print('Please enter an integer value between {} and {}'
                  .format(minimum, maximum))