Python Tutorial: Dictionaries (Key-value pair Maps) Basics

Reblogged from Shafiul Azam's Weblog:

Dictionaries are also known as maps. In fact they are collection of objects, but unlike Lists, each individual value of a map is accessed by an unique key, and so they are known as key-value pairs. Dictionaries are not sequences, hence maintains no left-to-right order. Operations You can create a map by the declaration: var_name = {key:value} Code after “>>>” in following examples means: you need to type the code in Python command line. Any line not beginning with “>>>” indicates an …

Well-formatting some of my old posts! :)
Advertisement