title: How do you fix: "AttributeError: 'list' object has no attribute 'player'"?
body: <p>I am making a platformer game that has moving platforms. I have a class where there are parameters to create a moving platform. I then put it all into an array and finally draw them in a for loop. However, I keep getting this error: "AttributeError: 'list' object has no attribute 'player'".</p>
  
  <pre><code>class MovingPlatform(Platform):
  
      def __init__(self, sprite_sheet_data, change_x, change_y, x, y, 
                   boundary_top, boundary_bottom, boundary_left, 
                   boundary_right):
  
          super().__init__(sprite_sheet_data)
  
          self.change_x = change_x
          self.change_y = change_y
  
          self.rect.x = x
          self.rect.y = y
  
          self.boundary_top = boundary_top
          self.boundary_bottom = boundary_bottom
          self.boundary_left = boundary_left
          self.boundary_right = boundary_right
  
          self.player = None
  
          self.level = None
  
  class Level(object):
  
       def __init__(self, player):
          self.platform_list = None
          self.platform_list = pygame.sprite.Group()
          self.player = player
  
      def update(self):
          self.platform_list.update()
  
      def draw(self, screen):
          self.platform_list.draw(screen)
  
  
  class Level01(Level):
  
      def __init__(self, player):
  
          Level.__init__(self, player)
  
          level_moving_blocks = 
          [[MovingPlatform(STONE_PLATFORM_MIDDLE, 1, 0, 1350, 280, 0, 
            0, 1350, 1600)], 
           [MovingPlatform(STONE_PLATFORM_MIDDLE, 0, 1, 2000, 400, 
            300, 500, 0, 0)]
          ]
  
          for block in level_moving_blocks:
              block.player = self.player
              block.level = self
              self.platform_list.add(block)
  
  
  
  Traceback (most recent call last):
    File "/Users/qingduliu/PycharmProjects/Platformer/Video Game.py", 
  line 672, in &lt;module&gt;
      main()
    File "/Users/qingduliu/PycharmProjects/Platformer/Video Game.py", 
  line 591, in main
      level_list = [Level01(player)]
    File "/Users/qingduliu/PycharmProjects/Platformer/Video Game.py", 
  line 374, in __init__
      block.player = self.player
  AttributeError: 'list' object has no attribute 'player'
  </code></pre>