code: def append_item(self, item):
          
          did_remove = self.remove_exit()
          item.menu = self
          self.items.append(item)
          if did_remove:
              self.add_exit()
docs: Add an item to the end of the menu before the exit item.
  
          Args:
              item (MenuItem): The item to be added.