appendix python review element access the items stored in dictionary are accessed based on the key part of the key/value pair accessing an entry in the dictionary also uses the subscript notationbut unlike list or tuplethe subscript value is one of the keys in the dictionary print'the state name is'states['ms'when using the subscript notation to access an entry in the dictionarythe given key must exist or an exception is raised as an alternativethe get(method can be usedwhich returns the value associated with the given key if it exists or returns none if the key does not existprintstates get'msprintstates get'mdprints mississippi prints none the collection can be traversed using python' iterator mechanism provided through the for statement the traversal is made over the keys in the dictionary to access the corresponding valuesimply use the subscript notation for key in classlevel printkey'='classlevel[keyyou can obtain list of the keys or values stored in the dictionary using the appropriate methodkeylist states keys(valuelist states values(dictionary modification the value associated with key in the dictionary can be changed using the dictionary subscript notation with the variable name on the right side of an assignment statement for examplethe following code segment corrects the entry for dc in the states dictionary and then prints the contents of the dictionarystates['dc''district of columbiaprintstates which results in{'va''virginia''al''alabama''ms''mississippi''dc''district of columbia'new entries can also be added to dictionary using the dictionary subscript notation thusif the key existsits corresponding value is modifiedif the key does not exista new key/value pair is added to the dictionarystates['or''oregonstates['vt''vermontprintlen(statesprints