code: def confirm(question, default=True):
      
      valid = {"": default, "yes": True, "y": True, "no": False, "n": False}
      while 1:
          choice = input(question + (" [Y/n] " if default else " [y/N] ")).lower()
          if choice in valid:
              return valid[choice]
          print("Please respond with 'y' or 'n' ")
docs: Ask a yes/no question interactively.
  
      :param question: The text of the question to ask.
      :returns: True if the answer was "yes", False otherwise.