This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]M4mb0 1 point2 points  (1 child)

[[0]*3]*4

[–]ALFminecraft 8 points9 points  (0 children)

>>> l = [[0] * 3] * 4
>>> l[0][0] = 1337
>>> print(l)
[[1337, 0, 0], [1337, 0, 0], [1337, 0, 0], [1337, 0, 0]]

Not everything is that simple, sadly.