when I initialize an array in python like so and then assign an element to a different value and then print out the 2d list
dist = [[0]*3]*3
dist[1][1] = 1
It gives me this
[[0,1,0],[0,1,0],[0,1,0]]
Can someone explain to me why the whole column has changed instead of just the specific element?