code: def prompt_for_input(message, input_type=None):
      
      while True:
          output = prompt.query(message)
  
          if input_type:
              try:
                  output = input_type(output)
              except ValueError:
                  error_message('Invalid input type')
                  continue
  
          break
  
      return output
docs: Prints prompt instruction and does basic input parsing.