dictionaries dictionaries are arbitrary collections of objects indexed by numbersstringsor other immutable objects dictionaries themselves are mutablehowevertheir index keys must be immutable the following table contains all the dictionary methods and their descriptionsmethod description len(dnumber of items in clear(removes all items from copy(makes shallow copy of fromkeys( [,value]returns new dictionary with keys from sequence and values set to value get( [, ]returns [kif foundor else returns vor none if is not given items(returns sequence of key:value pairs in keys(returns sequence of keys in pop( [,default]returns [kand removes it from if [kis not foundit returns default or raises keyerror popitem(removes random key:value pair from and returns it as tuple setdefault( [, ]returns [kif [kis not foundit returns and sets [kto update(badds all objects from to values(returns sequence of values in python dictionaries are the only built-in mapping type and they are similar to hash tables or associative arrays found in other languages they can be thought of as mapping from set of keys to set of values they are created using the syntax {key:valuefor examplethe following creates dictionary mapping words to numeralsd ={'one' 'two' 'three' creates dictionary