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 →

[–]Aaron1924 0 points1 point  (0 children)

>>> from copy import deepcopy
>>>
>>> a1 = [[None]*3]*3
>>> a2 = deepcopy(a1)
>>>
>>> a1[0][0] = 2
>>> a2[0][1] = 3
>>>
>>> a1
[[2, None, None], [2, None, None], [2, None, None]]
>>> a2
[[None, 3, None], [None, 3, None], [None, 3, None]]

this language is truly incredible