My code is as follows:
l = [[]] * 10
for i in range(10):
l[i] += [0]
I need a 10 x 1 matrix of zeros.
It doesn't work as expected because the list comprises references to the same variable. As a result, I am getting a 10 x 10 matrix.
How to prevent it?