Dictionaries are unordered datasets and are accessed via keys and not via their position. A dictionary is an associative array (also known as hashes). Any key of the dictionary is associated (or mapped) to a value. The first variable is the key
, while the second one is the value
; see the following example. The curly parentheses are used. The second value could be any data type such as a string, an integer, or a real number:
>>>houseHold={"father":"John","mother":"Mary","daughter":"Jane"} >>> household {'father': 'John', 'daughter': 'Jane','mother': 'Mary'} >>> type(houseHold) <class 'dict'> >>>houseHold['father'] 'John'