I was looking at a simple code that I did not understand. I think it is the same as the operation priority, but I did not know it properly.
stack = ["apple", 1]
heap = {}
heap[stack.pop()] = stack.pop()
In JavaScript, the result of this code is heap = {1:"apple"}
.
But the result is heap = {"apple" : 1}
in python.
I would like to know why Python has these results.