I have this 7x7 two-dimensional array:
l=[[1, 1, 1, 1, 1, 1, 1],
[1, 0, 2, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 1],
[1, 1, 1, 1, 1, 1, 1]]
As you can see, l[1][2]=2. When I print it, the element is printed correctly. No problem here. But when I try to change it from "2" to "3" or any other number, the program changes all the elements on that column (in this case the 3rd column) except for the first and last ones. For example, if I type this code:
l[1][2]=5
and then print the two-dimensional array, I get this:
l=[[1, 1, 1, 1, 1, 1, 1],
[1, 0, 5, 0, 0, 0, 1],
[1, 0, 5, 0, 0, 0, 1],
[1, 0, 5, 0, 0, 0, 1],
[1, 0, 5, 0, 0, 0, 1],
[1, 0, 5, 0, 0, 0, 1],
[1, 1, 1, 1, 1, 1, 1]]
This happens with every element that I choose. Instead of changing only that element, it changes the entire column. Does anyone know what might be the problem? Thank you!