diff options
author | Puneeth Chaganti | 2010-10-26 20:54:21 +0530 |
---|---|---|
committer | Puneeth Chaganti | 2010-10-26 20:54:21 +0530 |
commit | 8d92700e2cff705b775093e7d3d668b5e713a4e9 (patch) | |
tree | 328b2a51eef96d62e67d02570c83bdf70b21efb1 | |
parent | 09bc218715a412690c4881dd3f3e8a2f4958d69e (diff) | |
download | st-scripts-8d92700e2cff705b775093e7d3d668b5e713a4e9.tar.gz st-scripts-8d92700e2cff705b775093e7d3d668b5e713a4e9.tar.bz2 st-scripts-8d92700e2cff705b775093e7d3d668b5e713a4e9.zip |
Reviewed dictionaries script.
-rw-r--r-- | dictionaries/script.rst | 20 | ||||
-rw-r--r-- | progress.org | 4 |
2 files changed, 13 insertions, 11 deletions
diff --git a/dictionaries/script.rst b/dictionaries/script.rst index 1f5d102..c3539f6 100644 --- a/dictionaries/script.rst +++ b/dictionaries/script.rst @@ -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? : <put date stamp here, if OK> [2010-10-05] +.. #[Puneeth: Quickref] ============ Dictionaries @@ -49,6 +50,8 @@ indexes, dictionaries have keys or strings as indexes. 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 @@ your IPython interpreter. 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 @@ dictionary. For that we can use ``in``, '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 --git a/progress.org b/progress.org index 9c07b9e..22535cc 100644 --- a/progress.org +++ b/progress.org @@ -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 | | | |