What is the principle of sorting is used in Python?
>>> dict = {'a':'paul', 'b':'max', 'c':'bill'}
>>> dict
{'a': 'paul', 'c': 'bill', 'b': 'max'}
Why not?
{'a': 'paul', 'b': 'max', 'c': 'bill'}
What is the principle of sorting is used in Python?
>>> dict = {'a':'paul', 'b':'max', 'c':'bill'}
>>> dict
{'a': 'paul', 'c': 'bill', 'b': 'max'}
Why not?
{'a': 'paul', 'b': 'max', 'c': 'bill'}
Dictionaries in python are unordered collections:
It is best to think of a dictionary as an unordered set of key: value pairs, with the requirement that the keys are unique (within one dictionary).
Though, you can have an ordered dictionary by using collections.OrderedDict.