(question: str)
Ask the user the question until the user inputs a valid answer.
Ask the user the question until the user inputs a valid answer.
Ask the user the question until the user inputs a valid answer .
def ask_yes_no(question: str) -> bool:
    """Ask the user the question until the user inputs a valid answer."""
    while True:
        try:
            print("{0} [y/n]".format(question))
            return strtobool(input().lower())
        except ValueError:
            pass
def ask_yes_no ( question : str ) -> bool : while True : try : print ( "{0} [y/n]" . format ( question ) ) return strtobool ( input ( ) . lower ( ) ) except ValueError : pass