table item methods and operations for dictionaries description returns the number of items in returns the item of with key sets [kto del [kremoves [kfrom in returns true if is key in clear(removes all items from copy(makes copy of fromkeys( [,value]create new dictionary with keys from sequence and values all set to value get( [, ]returns [kif foundotherwisereturns has_key(kreturns true if has key kotherwisereturns false (deprecateduse the in operator instead python onlym items(returns sequence of (key,valuepairs keys(returns sequence of key values pop( [,default]returns [kif found and removes it from motherwisereturns default if supplied or raises keyerror if not popitem(removes random (key,valuepair from and returns it as tuple setdefault( [ ]returns [kif foundotherwisereturns and sets [kv update(badds all objects from to values(returns sequence of all values in len(mm[km[ ]= most of the methods in table are used to manipulate or retrieve the contents of dictionary the clear(method removes all items the update(bmethod updates the current mapping object by inserting all the (key,valuepairs found in the mapping object the get( [, ]method retrieves an object but allows for an optional default valuevthat' returned if no such key exists the setdefault( [, ]method is similar to get()except that in addition to returning if no object existsit sets [kv if is omittedit defaults to none the pop(method returns an item from dictionary and removes it at the same time the popitem(method is used to iteratively destroy the contents of dictionary the copy(method makes shallow copy of the items contained in mapping object and places them in new mapping object the fromkeys( [,value]method creates new mapping with keys all taken from sequence the type of the resulting mapping will be the same as the value associated with all of these keys is set to none unless an alternative value is given with the optional value parameter the fromkeys(method is defined as class methodso an alternative way to invoke it would be to use the class name such as dict fromkeys(the items(method returns sequence containing (key,valuepairs the keys(method returns sequence with all the key valuesand the values(method returns sequence with all the values for these methodsyou should assume that the only safe operation that can be performed on the result is iteration in python the result is listbut in python the result is an iterator that iterates over the current contents of the mapping if you write code that simply assumes it is an iteratorit will lib fl ff