0

can someone explain this, I understand that some sort of lazy initialization is taking place, but unable to find any documentation/support for the same.

a = [[0]*3]*3
a[0][0] = 1
print(a)

output:

[[1, 0, 0], [1, 0, 0], [1, 0, 0]]

0 Answers0