data collections you've learned all you want to about collections for the moment dictionary basics lists allow us to store and retrieve items from sequential collections when we want to access an item in the collectionwe look it up by index--its position in the collection many applications require more flexible way to look up information for examplewe might want to retrieve information about students or employees based on their social security numbers in programming terminologythis is key-value pair we access the value (student informationassociated with particular key (social security numberif you think bityou can come up with lots of other examples of useful key-value pairsnames and phone numbersusernames and passwordszip codes and shipping costsstate names and capitalssales items and quantity in stocketc collection that allows us to look up information associated with arbitrary keys is called mapping python dictionaries are mappings some other programming languages provide similar structures called hashes or associative arrays dictionary can be created in python by listing keyvalue pairs inside of curly braces here is simple dictionary that stores some fictional usernames and passwordspasswd {"guido":"superprogrammer""turing":"genius""bill":"monopoly"notice that keys and values are joined with ":"and commas are used to separate the pairs the main use for dictionary is to look up the value associated with particular key this is done through indexing notation passwd["guido"'superprogrammerpasswd["bill"'monopolyin general[returns the object associated with the given key dictionaries are mutablethe value associated with key can be changed through assignment passwd["bill""bluescreenpasswd {'turing''genius''bill''bluescreen''guido''superprogrammer'in this exampleyou can see that the value associated with 'billhas changed to 'bluescreenalso notice that the dictionary prints out in different order from how it was originally created this is not mistake mappings are inherently unordered internallypython stores dictionaries in way that makes key lookup very efficient when dictionary is printed outthe order of keys will