# HG changeset patch # User Santosh Vattam # Date 1273067310 -19800 # Node ID 331c5fdc06d4c4b3b0168a7005749a84e0671ca1 # Parent 50716c7c4c0c43b24e4af67a34534bcf49aeb860 Minor edits to dictionaries.org. diff -r 50716c7c4c0c -r 331c5fdc06d4 dictionary.org --- a/dictionary.org Wed May 05 17:31:32 2010 +0530 +++ b/dictionary.org Wed May 05 19:18:30 2010 +0530 @@ -22,6 +22,10 @@ player = {'Mat': 134,'Inn': 233, 'Runs': 10823, 'Avg': 52.53} + Let's see what player contains by typing: + + print player + Its a dictionary storing statistics of a cricket player. Here 'Mat', 'Inn' etc are the keys. Now in order to get the 'average' of this player we simply type @@ -31,6 +35,7 @@ To add a new key-value pair to this dictionary we type player['Name'] = 'Rahul Dravid' print player + As you can see the given key-value pair has been added. Please note that Python dictionaries don't maintain the order in which the key-value pairs are stored. The order might change as we add new entries.