code: def input_option(message, options="yn", error_message=None):
      
      def _valid(character):
          if character not in options:
              print(error_message % character)
      return input("%s [%s]" % (message, options), _valid, True, lambda a: a.lower())
docs: Reads an option from the screen, with a specified prompt.
          Keeps asking until a valid option is sent by the user.