How does one create a method to add things in a list in Python?
<p>My background is in Java and I was only recently learning how to do some object oriented programming in it. I am currently learning python as well and I wondering how this Java code translates into python.</p>

<p>Assuming I have a HockeyPlayer class that has a jerseyNumber instance variable:</p>

<pre><code>public void addPlayer(HockeyPlayer h){
   if(hockeyPlayers == null){
      hockeyPlayers = new ArrayList&lt;HockeyPlayer&gt;();
   }
   if(jerseyNumberExists(h.getJerseyNumber()) == false){
       // this jersey number is available; add the player
       hockeyPlayers.add(h);
   }
}
</code></pre>
