Data structures, like variables, contain references to objects, rather than the objects themselves.

Table of contents
Referencing the same object in multiple places
Let's point a variable row to a list of three zeroes:
>>> row=[0,0,0]Now let's make a new variable that points to a list-of-lists:
>>> boat=[row,row,row]We now have a list of three lists, each with three zeroes in it:
>>> boat[[0, 0, 0], [0, 0, 0], [0, 0, 0]]What would happen if we look up index 1, and then index 1 again, and change that to the number 1?
>>> boat[1][1]=1What do you think might happen? What will change in our lists?
We're looking up the second list, and then the second value in the second list, and assigning that value to 1.
So we've asked to change the middle item in the middle list to the number 1.
That's not quite what happens though:
>>> boat[[0, 1, 0], [0, 1, 0], [0, 1, 0]]Instead, we changed the middle number in all three of our inner lists.
Why did this happen?
Well...
Data structures store references, not objects
Lists in Python don't actually …