Why the two stack list calculation are different

后端 未结 0 676
生来不讨喜
生来不讨喜 2020-12-10 16:18

Can anyone help me to check why python gives two different result of a and b?

a = [[0,0],[0,0]]
b = [[0]*2]*2
a[0][0] += 1
b[0][0] += 1

code

相关标签:
回答
  • 消灭零回复
提交回复
热议问题