By cphoenix : Add Edit Top Back Help

A dictionary stores key-value pairs in a hashtable --- In Python, a dictionary can use almost anything as a key, as long as the identity of the thing won't change.

Dictionaries are written as {"key":"value", 1:42}

>>> dict = {1:2, 5:6}
>>> dict[1]
2
>>> dict[5] = 7
>>> dict["ten"] = 10
>>> dict
{1:2, 5:7, "ten":10}