(message, options)
Ask the message interactively, with the given possible responses
Ask the message interactively, with the given possible responses
Ask the message interactively with the given possible responses
def ask(message, options):
    # type: (str, Iterable[str]) -> str
    """Ask the message interactively, with the given possible responses"""
    while 1:
        _check_no_input(message)
        response = input(message)
        response = response.strip().lower()
        if response not in options:
            print(
                'Your response (%r) was not one of the expected responses: '
                '%s' % (response, ', '.join(options))
            )
        else:
            return response
def ask ( message , options ) : # type: (str, Iterable[str]) -> str while 1 : _check_no_input ( message ) response = input ( message ) response = response . strip ( ) . lower ( ) if response not in options : print ( 'Your response (%r) was not one of the expected responses: ' '%s' % ( response , ', ' . join ( options ) ) ) else : return response