title: Call a class function in a self in another function so that the attributes only include one and the variable not included but is self function?
body: <p>This code is in the main function:</p>
  
  <p>Player and Computer are lists in this format:</p>
  
  <pre><code>player = ["name", 10, 20, 30]
  </code></pre>
  
  <p>10 is the health, 20 is the strength, and 30 is the dexterity</p>
  
  <pre><code># Get the character for the user and the computer.
  player = character_choices.get_and_remove_character(choice)
  computer = character_choices.get_random_character()
  
  # Preparation for the battle
  print ("You have picked a " + player.name)
  print ("The computer picked " + computer.name)
  print ("Let's battle!\n")
  
  # Battle Loop
  rnd = 1
  while (player.hit_points &gt; 0 and computer.hit_points &gt; 0):
      print ("Round: " + str(rnd))
      player.attack (computer)
      computer.attack (player)
  </code></pre>
  
  <p>This is the function:</p>
  
  <pre><code>def attack (self, enemy):
      self.player = [self]
      if self.player[3] == enemy[3]:
  </code></pre>
  
  <p>I do not know how to call the player variable within the attack function in this format I can not change the attributes and I do not know how to get the player list items to compare to the enemies list items and fight.</p>