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. Arrays Arrays are another kind of sequence object, having special properties optimized for numerical applications. Arrays and functions dealing with them are defined in the module Numeric , which also contains the math functions introduced earlier. The number of dimensions is limited to fourty.