Skip to content

Instantly share code, notes, and snippets.

@paulodiniz
Created January 20, 2016 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulodiniz/5366ca7902405e35f4f8 to your computer and use it in GitHub Desktop.
Save paulodiniz/5366ca7902405e35f4f8 to your computer and use it in GitHub Desktop.
import collections
print 'Regular dictionary:'
d = {}
d['a'] = 'A'
d['b'] = 'B'
d['c'] = 'C'
d['d'] = 'D'
d['e'] = 'E'
for k, v in d.items():
print k, v
print '\nOrderedDict:'
d = collections.OrderedDict()
d['a'] = 'A'
d['b'] = 'B'
d['c'] = 'C'
d['d'] = 'D'
d['e'] = 'E'
for k, v in d.items():
print k, v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment