Advertisement
here2share

# OrderedDict.py

Jul 22nd, 2016
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. # OrderedDict.py
  2.  
  3. d={}
  4. d['p'] = 'P'
  5. d['y'] = 'Y'
  6. d['t'] = 'T'
  7. d['h'] = 'H'
  8. d['o'] = 'O'
  9. d['n'] = 'N'
  10. print [[k,v] for k,v in d.items()]
  11. print
  12.  
  13. import collections
  14. d = collections.OrderedDict()
  15. d['p'] = 'P'
  16. d['y'] = 'Y'
  17. d['t'] = 'T'
  18. d['h'] = 'H'
  19. d['o'] = 'O'
  20. d['n'] = 'N'
  21. print [[k,v] for k,v in d.items()]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement