the map adt in this sectionwe introduce the map adtand define its behaviors to be consistent with those of python' built-in dict class we begin by listing what we consider the most significant five behaviors of map as followsm[ ]return the value associated with key in map mif one existsotherwise raise keyerror in pythonthis is implemented with the special method getitem [kvassociate value with key in map mreplacing the existing value if the map already contains an item with key equal to in pythonthis is implemented with the special method setitem del [ ]remove from map the item with key equal to kif has no such itemthen raise keyerror in pythonthis is implemented with the special method delitem len( )return the number of items in map in pythonthis is implemented with the special method len iter( )the default iteration for map generates sequence of keys in the map in pythonthis is implemented with the special method iter and it allows loops of the formfor in we have highlighted the above five behaviors because they demonstrate the core functionality of map--namelythe ability to queryaddmodifyor delete keyvalue pairand the ability to report all such pairs for additional conveniencemap should also support the following behaviorsk in mreturn true if the map contains an item with key in pythonthis is implemented with the special contains method get(kd=none)return [kif key exists in the mapotherwise return default value this provides form to query [kwithout risk of keyerror setdefault(kd)if key exists in the mapsimply return [ ]if key does not existset [kd and return that value pop(kd=none)remove the item associated with key from the map and return its associated value if key is not in the mapreturn default value (or raise keyerror if parameter is none