On 18-Oct-2013, at 17:13, Corinne Landers <corinne.land...@live.com> wrote:
> self.grid_x = x
> self.grid_y = y
> self.grid_z = z
> 
> self.grid = []
> self.grid2D = []
> 

So here you create a list, self.grid2D.


> for i in range(self.grid_y):
>             row = [0]*x
>             self.grid2D.append(row)
> 

Here you are adding more elements to that list.

> for k in range(z):
>             self.grid.append(self.grid2D) #Creates list of x by y grids
> 

But here you keep appending self.grid2D multiple times to self.grid.  Not z 
different copies, but they're all the exact name list object, referenced 
multiple times.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to