title: List indices must be integers, not object
body: <p>Having a problem with a code for homework. Basically what I'm trying to do is take in a list of objects and pass them to my fire method.</p>
  
  <pre><code>def fire(self,targets):
      i = 0
      for i in targets:
          x,y = targets[i].position
          tx,ty = self.position
          d = getDist(targets[i].position, self.position)
  </code></pre>
  
  <p>Whenever I call the fire method and pass in the objects it points me to line 17 which is the <code>x,y = targets[i].position</code> line and says "TypeError: list indices must be integers, not Bomber"</p>
  
  <p>Bomber is the name of the class. I call the fire method like this:</p>
  
  <pre><code>bOne.fire([bTwo, tOne, tTwo, tThree])
  </code></pre>
  
  <p>Any help is much appreciated.</p>