The code below:
rect_pos = {}
rect_pos_single = [[0,0], [50, 0], [50, 100], [0, 100]]
i = 0
while (i<3):
for j in range(4):
rect_pos_single[j][0] += 50
print rect_pos_single
rect_pos[i] = rect_pos_single
i += 1
print rect_pos
The code prints subsequent iterations of the variable "rect_pos_single". Next, I add them to dictionary "rect_pos". Keys change, but value is always the same - last iteration. I do not understand why?