code: def prompt_for_numbered_choice(self, choices, title=None, prompt=">"):
          
          if choices is None or len(choices) < 1:
              raise Exception('choices list must contain at least one element.')
  
          while True:
              self.clear()
  
              if title:
                  self.screen.println(title + "\n")
  
              for i in range(0, len(choices)):
                  print('   {:<4}{choice}'.format(str(i + 1) + ') ', choice=choices[i]))
  
              answer = self.screen.input('\n{} '.format(prompt))
  
              try:
                  index = int(answer) - 1
                  if 0 <= index < len(choices):
                      return index
              except Exception as e:
                  continue
docs: Displays a numbered vertical list of choices from the provided list of strings.
          :param choices: list of choices to display
          :param title: optional title to display above the numbered list
          :param prompt: prompt string. Default is ">"
          :return: an int representing the selected index.