title: For and lists in Python
body: <p>I've a problem with Python. I've this main:</p>
  
  <pre><code>def main():
      cats = []
      for x in range(1, 11):
          x = Cat(x)
          cats.append(x)  
  
  
      listPussa = []
      for x in range(1,21):
         x = Pussa(x)
         listPussa.append(x)
  
  
      PussaIndex = 0
      for cat in cats:
          num = cat.getcatNum()
  
          if num % 2 != 0:
              for i in range(4):
                  cat.addPussa(listPussa[PussaIndex])
                  PussaIndex += 1
  
      for cat in cats:
        print cat.mixeta()
  </code></pre>
  
  <p>The problem is that when I use this function in the main, to print the list of cats:</p>
  
  <pre><code>def mixeta(self): #This is a method of the class Cat, it returns a few strings depending on how many objects Pussa has the object. 
      if len(self.__listPussa) is 0:  #When the cat has no one, it returns that
          return "Miau!", self.getcatNum(), "La llista de pusses esta buida" #The string menas that the list of Pussa is empty.
  
      else: #When it has at least 1
          listIdPussa = [] #I created a new list 
          for pussa in self.__listPussa: #And for every objcet Pussa in the list of Pussa
              listIdPussa.append(pussa.getIdPussa()) #I save every idPussa in the list.
  
          return  "Miau!", self.getcatNum(), "El gat esta infectat. El nombre total de pusses es ", len(self.__listPussa), listIdPussa #So, at the end it returns "Meow", the number of the cat, and it says that the cat is "infected" and the total number of objects Pussa is X and each id from every object
  </code></pre>
  
  <p>The result it has to be that:</p>
  
  <pre><code>('Miau!', 1, 'El gat esta infectat. El nombre total de pusses es ', 4[0,1,2,3])
  
  ('Miau!', 2, 'La llista esta buida') # It means the list has no objects Pussa
  
  ('Miau!', 3, 'El gat esta infectat. El nombre total de pusses es ', 4[4,5,6,7])
  
  ('Miau!', 4, 'La llista esta buida')
  </code></pre>
  
  <p>And this way until it reach Miau, 10. </p>
  
  <p>But the problem is that my main prints that:</p>
  
  <pre><code>('Miau!', 1, 'El gat esta infectat. El nombre total de pusses es ', 20, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20])
  
  ('Miau!', 2, 'El gat esta infectat. El nombre total de pusses es ', 20, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20])
  
  ('Miau!', 3, 'El gat esta infectat. El nombre total de pusses es ', 20, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20])
  
  ('Miau!', 4, 'El gat esta infectat. El nombre total de pusses es ', 20, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20])
  </code></pre>
  
  <p>And that for all cats. What can I do?</p>