tutorial introduction dictionaries dictionary is an associative array or hash table that contains objects indexed by keys you create dictionary by enclosing the values in curly braces (})like thisstock "name"goog""shares "price to access members of dictionaryuse the key-indexing operator as followsname stock["name"value stock["shares"shares["price"inserting or modifying objects works like thisstock["shares" stock["date""june although strings are the most common type of keyyou can use many other python objectsincluding numbers and tuples some objectsincluding lists and dictionariescannot be used as keys because their contents can change dictionary is useful way to define an object that consists of named fields as shown previously howeverdictionaries are also used as container for performing fast lookups on unordered data for examplehere' dictionary of stock pricesprices "goog "aapl "ibm "msft an empty dictionary is created in one of two waysprices {an empty dict prices dict(an empty dict dictionary membership is tested with the in operatoras in the following exampleif "scoxin pricesp prices["scox"elsep this particular sequence of steps can also be performed more compactly as followsp prices get("scox", to obtain list of dictionary keysconvert dictionary to listsyms list(pricessyms ["aapl""msft""ibm""goog"use the del statement to remove an element of dictionarydel prices["msft"dictionaries are probably the most finely tuned data type in the python interpreter soif you are merely trying to store and work with data in your programyou are almost always better off using dictionary than trying to come up with some kind of custom data structure on your own lib fl ff