how to iterate through ordereddict in python

Solutions on MaxInterview for how to iterate through ordereddict in python by the best coders in the world

showing results for - "how to iterate through ordereddict in python"
Taina
19 Jul 2019
1from collections import OrderedDict
2
3d = OrderedDict()
4d['a'] = 1
5d['b'] = 2
6d['c'] = 3
7
8for key, value in d.items():
9    print key, value