I'm new to python. My current version of it is: 2.7.16 So, in the code I have a function:
def func (coords):
xb, yb, xe, ye = coords.values()
print(coords, 'order__') #1
Then I call it:
func({ 'xb': 0, 'yb': 0, 'xe': 40, 'ye': 20 })
But as I found out later I got an error somewhere because the things didn't work well. I added that print and it showed:
({'xb': 0, 'yb': 0, 'ye': 20, 'xe': 40}, 'order__')
So, as you see the order of properties changed and that causes the destructurisation to work not correctly. Two questions: 1. Why is it so? 2. What should I do to make my code work? My solution is to make like this:
xb = coords['xb']
yb = coords['yb']
and so on. But is there a better solution? May be I don't know about it yet