I have the following piece of code:
stack = [1, 2, 3]
lst = [[0 for _ in range(5)] for _ in range(5)] # Just a 5x5 2D list of 0
The following assignment didn't behave like I expected
lst[stack.pop()][stack.pop()] = stack.pop()
I thought the above would be lst[3][2] = 1
. Turn out it's lst[2][1] = 3
I kinda have a vague idea why, but I do want to know more about this behavior. Can you guys point me to any doc or article about this?