array1 = [[0,0,0],
[0,0,0],
[0,0,0]]
t = [0]*3
array2 = [t]*3
array1[0][0] = 1
array2[0][0] = 1
print(array1)
print(array2)
我希望得到相同的结果:
[[1, 0, 0], [0, 0, 0], [0, 0, 0]]
但是我已经收到array2了:
[[1, 0, 0], [1, 0, 0], [1, 0, 0]]