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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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