parameters: (prompt, default=None, interrupt=None)
return_statement: return answers[ans]
docstring: Asks a question and returns a boolean (y/n) answer.
  
      If default is given (one of 'y','n'), it is used if the user input is
      empty. If interrupt is given (one of 'y','n'), it is used if the user
      presses Ctrl-C. Otherwise the question is repeated until an answer is
      given.
  
      An EOF is treated as the default answer.  If there is no default, an
      exception is raised to prevent infinite loops.
  
      Valid answers are: y/yes/n/no (match is not case sensitive).
docstring_summary: Asks a question and returns a boolean (y/n) answer.
docstring_tokens: Asks a question and returns a boolean ( y / n ) answer .
function: def ask_yes_no(prompt, default=None, interrupt=None):
      """Asks a question and returns a boolean (y/n) answer.
  
      If default is given (one of 'y','n'), it is used if the user input is
      empty. If interrupt is given (one of 'y','n'), it is used if the user
      presses Ctrl-C. Otherwise the question is repeated until an answer is
      given.
  
      An EOF is treated as the default answer.  If there is no default, an
      exception is raised to prevent infinite loops.
  
      Valid answers are: y/yes/n/no (match is not case sensitive)."""
  
      answers = {'y':True,'n':False,'yes':True,'no':False}
      ans = None
      while ans not in answers.keys():
          try:
              ans = input(prompt+' ').lower()
              if not ans:  # response was an empty string
                  ans = default
          except KeyboardInterrupt:
              if interrupt:
                  ans = interrupt
          except EOFError:
              if default in answers.keys():
                  ans = default
                  print()
              else:
                  raise
  
      return answers[ans]
function_tokens: def ask_yes_no ( prompt , default = None , interrupt = None ) : answers = { 'y' : True , 'n' : False , 'yes' : True , 'no' : False } ans = None while ans not in answers . keys ( ) : try : ans = input ( prompt + ' ' ) . lower ( ) if not ans : # response was an empty string ans = default except KeyboardInterrupt : if interrupt : ans = interrupt except EOFError : if default in answers . keys ( ) : ans = default print ( ) else : raise return answers [ ans ]