collection data types subtler approach we call dict get(with default value of if the word is already in the dictionarydict get(will return the associated numberand this value plus will be set as the item' new value if the word is not in the dictionarydict get(will return the supplied default of and this value plus ( will be set as the value of new item whose key is the string held by word to clarifyhere are two code snippets that do the same thingalthough the code using dict get(is more efficientwords[wordwords get(word if word not in wordswords[word words[word+ in the next subsection where we cover default dictionarieswe will see an alternative solution once we have accumulated the dictionary of wordswe iterate over its keys (the wordsin sorted orderand print each word and the number of times it occurs using dict get(allows us to easily update dictionary valuesproviding the values are single items like numbers or strings but what if each value is itself collectionto demonstrate how to handle this we will look at program that reads html files given on the command line and prints list of each unique web site that is referred to in the files with list of the referring files listed indented below the name of each web site structurallythe program (external_sites pyis very similar to the unique words program we have just reviewed here is the main part of the codesites {for filename in sys argv[ :]for line in open(filename) while truesite none line find("if - +len("for in range(ilen(line))if not (line[jisalnum(or line[jin -")site line[ :jlower(break if site and in sitesites setdefault(siteset()add(filenamei elsebreak