iterators more formally in and also note the syntax of the last example in this listing we have to enclose it in list call in python for similar reasons--keys in returns an iterable objectinstead of physical list the list call forces it to produce all its values at once so we can print them interactivelythough this call isn' required some other contexts in xkeys builds and returns an actual listso the list call isn' even needed to display resultmore on this later in this changing dictionaries in place let' continue with our interactive session dictionarieslike listsare mutableso you can changeexpandand shrink them in place without making new dictionariessimply assign value to key to change or create an entry the del statement works heretooit deletes the entry associated with the key specified as an index notice also the nesting of list inside dictionary in this example (the value of the key 'ham'all collection data types in python can nest inside each other arbitrarilyd {'eggs' 'spam' 'ham' ['ham'['grill''bake''fry'change entry (value=listd {'eggs' 'spam' 'ham'['grill''bake''fry']del ['eggs' {'spam' 'ham'['grill''bake''fry']delete entry ['brunch''baconadd new entry {'brunch''bacon''spam' 'ham'['grill''bake''fry']like listsassigning to an existing index in dictionary changes its associated value unlike listshoweverwhenever you assign new dictionary key (one that hasn' been assigned beforeyou create new entry in the dictionaryas was done in the previous example for the key 'brunchthis doesn' work for lists because you can only assign to existing list offsets--python considers an offset beyond the end of list out of bounds and raises an error to expand listyou need to use tools such as the append method or slice assignment instead more dictionary methods dictionary methods provide variety of type-specific tools for instancethe dictionary values and items methods return all of the dictionary' values and (key,valuepair tuplesrespectivelyalong with keysthese are useful in loops that need to step through dictionary entries one by one (we'll start coding examples of such loops in the next lists and dictionaries