|
但是当操作myList[0][1] = 1时,发现整个第二列都被赋值,变成
[[0,1,0],
[0,1,0],
[0,1,0],
[0,1,0]]
myList
=
[([
0
]
*
3
)
for
i
in
range
(
4
)]
避免浅拷贝。。。
时间: 2024-10-18 23:12:52
|
但是当操作myList[0][1] = 1时,发现整个第二列都被赋值,变成
[[0,1,0],
[0,1,0],
[0,1,0],
[0,1,0]]
myList
=
[([
0
]
*
3
)
for
i
in
range
(
4
)]
避免浅拷贝。。。