sscasc@tumkur dictionaries dictionary is container object that stores collection of key/value pairs it enables fast retrievaldeletionand updating of the value by using the key dictionary is collection that stores the values along with the keys the keys are like an index operator in listthe indexes are integers dictionary cannot contain duplicate keys each key maps to one value key and its corresponding value form an item (or entrystored in dictionaryas shown in figure the data structure is called "dictionarybecause it resembles word dictionarywhere the words are the keys and the wordsdefinitions is the values dictionary is also known as mapwhich maps each key to value the syntax of dictionary is as followsdictionary_name {keyvalueexampleport { "ssh" "telnet "dns" httpthe port variable refers to dictionary that contains port numbers as keys and its protocol names as values consider the following examplecompanies {"ibm""international business machines"" & :"larsen toubro"characteristics of dictionarythe keys in dictionary may have different types(stringintor floatthe values in dictionary may have different types the values in dictionary may be mutable objects the key of the dictionary cannot be changed keys are unique values can be anythingfor exampleliststringintand so on values can be repeated values can be changed dictionary is an unordered collectionwhich means that the order in which you have entered the items in dictionary may not be retained and you may get the items in different order the order of keyvalue pairs in dictionary are independent of the order of their insertion into the dictionary operations on the dictionary dictionary is mutablewe can add new valuesand delete and update old values accessing the values of dictionary the dictionary' values are accessed by using key consider dictionary of networking portsin order to access the dictionary' valuesthe key is considered port { "http" "telnet" "https"print(port[ ]>>'httpprint(port[ ]>>'httpsif the key is not foundthen the interpreter shows the preceding error deleting an item from the dictionary sp_python programming