Python 201 – OrderedDict
Python’s collections module has another great subclass of dict known as OrderedDict. As the name implies, this dictionary keeps track of the order of the keys as they are added. If you create a regular dict, you will note that it is an unordered data collection: >>> d = {‘banana’: 3, ‘apple’:4, ‘pear’: 1, ‘orange’: […]
Python 201 – OrderedDict Read More »