arithmetic_mean

mathtools.arithmetic_mean(sequence)

Arithmetic means of sequence as an exact integer.

>>> mathtools.arithmetic_mean([1, 2, 2, 20, 30])
11

As a rational:

>>> mathtools.arithmetic_mean([1, 2, 20])
Fraction(23, 3)

As a float:

>>> mathtools.arithmetic_mean([2, 2, 20.0])
8.0

Returns number.