Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- trying to understand dictionnary
- """
- dict1={
- "Menu1":1,
- "Menu2":2,
- "Menu3":3,
- }
- print dict1.keys()
- print dict1.values()
- print "---"
- print dict1.keys()[0]
- print dict1.keys()[2]
- print dict1.keys()[1]
- print "---"
- for i, d in enumerate(dict1, start=1):
- print str(i).ljust(2)+d.ljust(13)+str(dict1[d]).ljust(4)
Advertisement
Add Comment
Please, Sign In to add comment