Could you please tell me whats the difference between python dict on below two cases. First one prints the data in correct order but on second iteration P6 take precedence over P5. What will be the reason?
>>> a=["P3", "P4"]
>>> devices_by_dc = {}
>>> for b in a:
... devices_by_dc[b] = {}
>>> print devices_by_dc
{'P3': {}, 'P4': {}}
>>> a=["P5", "P6"]
>>> devices_by_dc = {}
>>> for b in a:
... devices_by_dc[b] = {}
{'P6': {}, 'P5': {}}