from collections import OrderedDict # Remembers the order the keys are added! x = OrderedDict(a=1, b=2, c=3)
Here is what the above code is Doing:
1. Create an empty OrderedDict.
2. Add the key-value pairs from the dict literal.
3. Return the OrderedDict.