Intro to
Programming
with Python

Fall 2010
course
navigation

nov 4

1. midterm projects
2. go over homework
3. this week: Chapter 11

New syntax: python "dictionary"
passwords = { "guido" : "superman", "bill" : "bluescreen", "santa" : "rudolph.the.red" } print passwords["bill"] for name in passwords.keys(): print "%s : %s" % (name, passwords[name])
Like lists, but
Look at python docs for dictionary methods; try a few out.
Go over text's example : counting words (see attachments)
http://cs.marlboro.edu/ courses/ fall2010/python/ notes/ nov_2
last modified Tuesday November 2 2010 9:30 am EDT

attachments [paper clip]

     name last modified size
   count_words.py Nov 2 2010 9:30 am 7.64kB [TXT]moby_dick.txt Nov 2 2010 2:16 am 1.20MB