operator [in del use explanation my_dict[kreturns the value associated with kotherwise its an error key in my_dict returns true if key is in the dictionaryfalse otherwise del my_dict[keyremoves the entry from the dictionary table operators provided by dictionaries in python our final python collection is an unordered structure called dictionary dictionaries are collections of associated pairs of items where each pair consists of key and value this key-value pair is typically written as key:value dictionaries are written as comma-delimited key:value pairs enclosed in curly braces for examplecapitals {'iowa':'desmoines','wisconsin':'madison'capitals {'wisconsin''madison''iowa''desmoines'we can manipulate dictionary by accessing value via its key or by adding another key-value pair the syntax for access looks much like sequence access except that instead of using the index of the item we use the key value to add new value is similar capitals {'iowa':'desmoines','wisconsin':'madison'print(capitals['iowa']capitals['utah']='saltlakecityprint(capitalscapitals['california']='sacramentoprint(len(capitals)for in capitalsprint(capitals[ ],is the capital of "kit is important to note that the dictionary is maintained in no particular order with respect to the keys the first pair added ('utah''saltlakecity'was placed first in the dictionary and the second pair added ('california''sacramento'was placed last the placement of key is dependent on the idea of "hashing,which will be explained in more detail in we also show the length function performing the same role as with previous collections dictionaries have both methods and operators table and table describe themand the session shows them in action the keysvaluesand items methods all return objects that contain the values of interest you can use the list function to convert them to lists you will also see that there are two variations on the get method if the key is not present in the dictionaryget will return none howevera secondoptional parameter can specify return value instead phone_ext={'david': 'brad': phone_ext {'brad' 'david' phone_ext keys(returns the keys of the dictionary phone_ext introduction