# HG changeset patch # User Puneeth Chaganti # Date 1288106661 -19800 # Node ID 75a182d6e9083d18bf025d28f7121a1d9ec775f8 # Parent 4c09238600e05c787f626868bcb9c16c53dfc28d Reviewed dictionaries script. diff -r 4c09238600e0 -r 75a182d6e908 dictionaries/script.rst --- a/dictionaries/script.rst Tue Oct 26 14:50:33 2010 +0530 +++ b/dictionaries/script.rst Tue Oct 26 20:54:21 2010 +0530 @@ -6,9 +6,9 @@ .. 1. Create dictionaries .. #. Add data to dictionaries .. #. Retrieve data -.. #. Familiarize using ``.keys()`` and ``.values()`` methods -.. #. Checking for container-ship of keys -.. #. Iterating over elements +.. #. use ``.keys()`` and ``.values()`` methods +.. #. Check for container-ship of keys +.. #. Iterate over elements .. Prerequisites .. ------------- @@ -22,6 +22,7 @@ External Reviewer : Checklist OK? : [2010-10-05] +.. #[Puneeth: Quickref] ============ Dictionaries @@ -49,6 +50,8 @@ Before we can proceed, start your IPython interpreter with the ``-pylab`` option. +.. #[Puneeth: We don't need pylab] + {{{ start ipython interpreter by issuing command ipython -pylab }}} {{{ switch to next slide, Creating dictionary }}} @@ -59,11 +62,11 @@ mt_dict = {} -Notice that unlike lists curly braces are used define ``dictionary``, +Notice that unlike lists, curly braces are used define ``dictionary``. {{{ move the mouse over curly braces to grab attention }}} -Now let us see how to create a filled dictionary, +Now let us see how to create a non-empty dictionary, :: extensions = {'jpg' : 'JPEG Image', 'py' : 'Python script', 'html' : 'Html document', 'pdf' : 'Portable Document Format'} @@ -146,10 +149,9 @@ 'py' in extensions 'odt' in extensions -So in short it will return ``True`` if the key is found in the -dictionary, and will return ``False`` if key is not present. Note that -we can check only for container-ship of keys in dictionaries and not -values. +It will return ``True`` if the key is found in the dictionary, and +will return ``False`` if key is not present. Note that we can check +only for container-ship of keys in dictionaries and not values. {{{ switch to next slide, Retrieve keys and values }}} diff -r 4c09238600e0 -r 75a182d6e908 progress.org --- a/progress.org Tue Oct 26 14:50:33 2010 +0530 +++ b/progress.org Tue Oct 26 20:54:21 2010 +0530 @@ -42,13 +42,13 @@ | 7.1 LO: | manipulating lists | 3 | Madhu | | | | 7.2 LO: | manipulating strings | 2 | Punch | Pending | | | 7.3 LO: | getting started with tuples | 2 | Nishanth | | | -| 7.4 LO: | dictionaries | 2 | Anoop | Pending | | +| 7.4 LO: | dictionaries | 2 | Anoop | Punch (Pending) | | | 7.5 LO: | sets | 2 | Nishanth | | | | 7.6 LO: | Assessment | 3 | Amit | | | |---------+----------------------------------------+-------+----------+---------------------------------------+-----------| | 8.1 LO: | getting started with functions | 3 | Nishanth | | | | 8.2 LO: | advanced features of functions | 3 | Punch | Pending | | -| 8.3 LO: | using python modules | 3 | Anoop | Pending | | +| 8.3 LO: | using python modules | 3 | Anoop | Punch (Pending) | | | 8.4 LO: | writing python scripts | 2 | Nishanth | | | | 8.5 LO: | testing and debugging | 2 | Amit | | | | 8.6 LO: | Assessment | 3 | Madhu | | |