What is the difference between these two ways of making a matrix in Python

前端 未结 0 1159
小蘑菇
小蘑菇 2020-11-30 19:22

If I were to make a 3x5 matrix in two ways

Matrix#1 A1 = [5*[0]]*3

Matrix#2 A2 = [5*[0] for i in range(3)]

and I changed the value of A[1][.2] to 2 usin

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