title: Changing a class variable for multiple instances using a single function
body: <p>I want to change the same variable of multiple instances to the same thing using a function. I want to use it for something like this:</p>
  
  <pre><code>Class Player:
     arbitrary value = 90
  </code></pre>
  
  <p>I create multiple players and put them in a list:</p>
  
  <pre><code>playerlist = [player1,player2,player3]
  
  def changevars(variable,newvariable):
     for x in playerlist:
         x.variable = newvariable
  </code></pre>
  
  <p>But then ofcourse I run into the 'variable not declared issue'.
  So what is the proper way to do something like this?</p>