original_docstring: 
      Format the options for a player's input, present them to the player and return the result of the decision.
  
      :param str header: Header for the action to take.
      :param dict actions_dict: dictionary of actions to perform. Given as such:
                                > {1: {'type': 'light_attack', 'stamina': 10, 'damage_multiplier': 1 }}
                                NOTE: Index should begin at 1. If a value of 0 is returned the player has not been
                                able to make a choice.
      :param bool attack: If True format this action as an attack.
      :param bool back: If True will add an extra item to the end for going back in the menus.
      :return: The resulting decision index from the actions_dict.
      :rtype: int
      
docstring: Format the options for a player's input, present them to the player and return the result of the decision.
docstring_tokens: Format the options for a player ' s input present them to the player and return the result of the decision .
code: def choose_action(header, actions_dict, attack=False, back=False):
      """
      Format the options for a player's input, present them to the player and return the result of the decision.
  
      :param str header: Header for the action to take.
      :param dict actions_dict: dictionary of actions to perform. Given as such:
                                > {1: {'type': 'light_attack', 'stamina': 10, 'damage_multiplier': 1 }}
                                NOTE: Index should begin at 1. If a value of 0 is returned the player has not been
                                able to make a choice.
      :param bool attack: If True format this action as an attack.
      :param bool back: If True will add an extra item to the end for going back in the menus.
      :return: The resulting decision index from the actions_dict.
      :rtype: int
      """
      options_string = f'> {header}:\n'
  
      for index, action in actions_dict.items():
          if attack:
              options_string += format_attack_actions(index,
                                                      action['type'],
                                                      action['stamina_cost'])
  
          else:
              options_string += f'{index}. {action["type"]}\n'
  
      if back:
          options_string += f'{len(actions_dict.items())+1}. Back\n'
  
      # Present the player with the options, excluding the last new line.
      print(options_string[:-1])
  
      # Obtain the answer from the player
      num_actions = len(actions_dict.keys()) if not back else len(actions_dict.keys()) + 1
  
      while True:
          result = input()
  
          if result.isdigit() and int(result) in actions_dict.keys():
              # If the result is a digit and in the actions' dict.
              return int(result)
  
          elif back and result.isdigit() and result == str(num_actions):
              # If the result is the back option
              return 0
  
          else:
              # The user has input the wrong answer.
              print(f'Please choose a number between 1 and {num_actions}')
code_tokens: def choose_action ( header , actions_dict , attack = False , back = False ) : options_string = f'> {header}:\n' for index , action in actions_dict . items ( ) : if attack : options_string += format_attack_actions ( index , action [ 'type' ] , action [ 'stamina_cost' ] ) else : options_string += f'{index}. {action["type"]}\n' if back : options_string += f'{len(actions_dict.items())+1}. Back\n' print ( options_string [ : - 1 ] ) num_actions = len ( actions_dict . keys ( ) ) if not back else len ( actions_dict . keys ( ) ) + 1 while True : result = input ( ) if result . isdigit ( ) and int ( result ) in actions_dict . keys ( ) : return int ( result ) elif back and result . isdigit ( ) and result == str ( num_actions ) : return 0 else : print ( f'Please choose a number between 1 and {num_actions}' )
short_docstring: Format the options for a player's input, present them to the player and return the result of the decision.
short_docstring_tokens: Format the options for a player ' s input present them to the player and return the result of the decision .
comment: """
      Format the options for a player's input, present them to the player and return the result of the decision.
  
      :param str header: Header for the action to take.
      :param dict actions_dict: dictionary of actions to perform. Given as such:
                                > {1: {'type': 'light_attack', 'stamina': 10, 'damage_multiplier': 1 }}
                                NOTE: Index should begin at 1. If a value of 0 is returned the player has not been
                                able to make a choice.
      :param bool attack: If True format this action as an attack.
      :param bool back: If True will add an extra item to the end for going back in the menus.
      :return: The resulting decision index from the actions_dict.
      :rtype: int
      """$SEP$# Present the player with the options, excluding the last new line.$SEP$# Obtain the answer from the player$SEP$# If the result is a digit and in the actions' dict.$SEP$# If the result is the back option$SEP$# The user has input the wrong answer.