Here's a snippet that I am finding puzzling. Why is that y[0][0] = 2
initializing all the columns in all rows?
Python 3.8.10 (default, Jun 2 2021, 10:49:15)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> x = []
>>> x.append([0])
>>> x.append([0])
>>> x.append([0])
>>> x.append([0])
>>> x
[[0], [0], [0], [0]]
>>> y = [ [0] * 1 ] * 4
>>> y
[[0], [0], [0], [0]]
>>> x == y
True
>>> x[0][0] = 2
>>> y[0][0] = 2
>>> x
[[2], [0], [0], [0]]
>>> y
[[2], [2], [2], [2]]
>>>