I am reading a dictionary in python2.6 as below I know Python3.6 will read the dictionary in the same order it is declared, but i need to achieve this in Python2.6 (OrderedDict is also not available in Python2.6)
numbermap = {'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5}
>>> for k, v in numbermap.iteritems():
... print(k,v)
...
('four', 4)
('three', 3)
('five', 5)
('two', 2)
('one', 1)
I want the output to be
('one',1)
('two', 2)
('three', 3)
('four', 4)
('five', 5)
I need to write as I read the dictionary. Any ideas to achieve this in Python 2.6?