Advanced calculations Mappings Mappings store associations between a set of keys and a set of values . They can be regarded as generalizations of sequences, because sequences are like mappings whose keys are a range of integers.
Mappings allow more general keys, but define no order of their elements.
There are other essential differences between sequences and mappings, so the two should be kept clearly separate. They allow any non-mutable object to be a key, i.e. any object that cannot change during its lifetime. Values can be arbitrary objects. The following example creates a dictionary containing the atomic masses of some chemical elements. It then adds another entry and finally calculates the mass of a water molecule.