table dictionary methods syntax description clear(removes all items from dict copy(returns shallow copy of dict fromkeyssvreturns dict whose keys are the items in sequence and whose values are none or if is given shallow and deep copying get(kreturns key ' associated valueor none if isn' in dict get(kvreturns key ' associated valueor if isn' in dict items(returns view of all the (keyvaluepairs in dict keys(returns view of all the keys in dict pop(kreturns key ' associated value and removes the item whose key is kor raises keyerror exception if isn' in pop(kvreturns key ' associated value and removes the item whose key is kor returns if isn' in dict popitem(returns and removes an arbitrary (keyvaluepair from dict dor raises keyerror exception if is empty setdefaultkvthe same as the dict get(methodexcept that if the key is not in dict da new item is inserted with the key kand with value of none or of if is given update(aadds every (keyvaluepair from that isn' in dict to dand for every key that is in both and areplaces the corresponding value in with the one in -- can be dictionaryan iterable of (keyvaluepairsor keyword arguments values(returns view of all the values in dict the dict items()dict keys()and dict values(methods all return dictionary views dictionary view is effectively read-only iterable object that appears to hold the dictionary' items or keys or valuesdepending on the view we have asked for in generalwe can simply treat views as iterables howevertwo things make view different from normal iterable one is that if the dictionary the view refers to is changedthe view reflects the change the other is that key and item views support some set-like operations given dictionary view and set or dictionary view xthe supported operations arev intersection union dictionary views can be thought of--and used as--iterablesthey are discussed in the text