parameters: (question, default=False)
docstring: Ask a yes/no question via raw_input() and return their answer.
  
    Modified from http://stackoverflow.com/a/3041990.
docstring_summary: Ask a yes/no question via raw_input() and return their answer.
docstring_tokens: Ask a yes / no question via raw_input () and return their answer .
function: def query_yes_no(question, default=False):
    """Ask a yes/no question via raw_input() and return their answer.
  
    Modified from http://stackoverflow.com/a/3041990.
    """
    prompt = " [%s/%%s]: "
    prompt = prompt % ('Y' if default is True  else 'y')
    prompt = prompt % ('N' if default is False else 'n')
  
    if default is None:
      default = 'INVALID'
  
    while True:
      sys.stdout.write(question + prompt)
      choice = raw_input().lower()
      if choice == '' and default != 'INVALID':
        return default
  
      if 'yes'.startswith(choice):
        return True
      elif 'no'.startswith(choice):
        return False
  
      print "Please respond with 'yes' or 'no' (or 'y' or 'n')."
function_tokens: def query_yes_no ( question , default = False ) : prompt = " [%s/%%s]: " prompt = prompt % ( 'Y' if default is True else 'y' ) prompt = prompt % ( 'N' if default is False else 'n' ) if default is None : default = 'INVALID' while True : sys . stdout . write ( question + prompt ) choice = raw_input ( ) . lower ( ) if choice == '' and default != 'INVALID' : return default if 'yes' . startswith ( choice ) : return True elif 'no' . startswith ( choice ) : return False print "Please respond with 'yes' or 'no' (or 'y' or 'n')."