I have a matrix
matrix = [[0.0] * 4] * 4
it looks like:
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
I'm trying to add an element to the second row, third column so that the matrix looks like this:
0 0 0 0
0 0 3 0
0 0 0 0
0 0 0 0
When I do
matrix[1][2] = 3
it gives:
0 0 3 0
0 0 3 0
0 0 3 0
0 0 3 0
How do I fix this?