I am a fresher using Python3.
I don't quite understand this:
a = [[0]*4]*1
b = [[1,2],[3,4]]
if I do:
a[0][0] = b[0][0]
Instead of only updating a[0][0]
with 1
:
a=[[1],[0],[0],[0]]
the whole list became:
a=[[1],[1],[1],[1]]
Can anyone advise how I can initiate a proper MxN matrix without getting this error?
Thanks a lot!