Page 6 - Lesson Note - DICTIONARIES
P. 6

del()
               deletes the dictionary from memory

















               Dictionary & Built in Functions

               Accessing dictionary elements

                 Functions         Description
                 <dict>.get()      to get value of the given key
                 <dict>.items()    to get all the items (key:value) pairs of the given
                                   dictionary
                 <dict>.keys()     to get all the keys of the dictionary
                 <dict>.values()   To get all the values of the dictionary

               get() method
               returns value for the specified key,  if key not available by default returns  None, can be
               made user defined







                                                          User defined return value



               keys() and values()
               keys() and values() method returns list of keys/values of a dictionary
   1   2   3   4   5   6   7   8   9   10   11