data collections these methods are mostly self-explanatory for illustrationhere is an interactive session using our password dictionarylist(passwd keys()['turing''bill''newuser''guido'list(passwd values()['genius''bluescreen''imanewbie''superprogrammer'list(passwd items()[('turing''genius')('bill''bluescreen'),('newuser''imanewbie'),('guido''superprogrammer')"billin passwd true 'fredin passwd false passwd get('bill','unknown''bluescreenpasswd get('john','unknown''unknownpasswd clear(passwd {example programword frequency let' write program that analyzes text documents and counts how many times each word appears in the document this kind of analysis is sometimes used as crude measure of the style similarity between two documents and is also used by automatic indexing and archiving programs (such as internet search enginesat the highest levelthis is just multi-accumulator problem we need count for each word that appears in the document we can use loop that iterates through each word in the document and adds one to the appropriate count the only catch is that we will need hundreds or thousands of accumulatorsone for each unique word in the document this is where (pythondictionary comes in handy we will use dictionary where the keys are strings representing words in the document and the values are ints that count how many times the word appears let' call our dictionary counts to update the count for particular wordwwe just need line of code something like thiscounts[wcounts[ this says to set the count associated with word to be one more than the current count for there is one small complication with using dictionary here the first time we encounter wordit will not yet be in counts attempting to access non-existent key produces run-time keyerror to guard against thiswe need decision in our algorithm