mean python code code example
Example 1: mean python code
>>> import statistics
>>> statistics.mean([4, 8, 6, 5, 3, 2, 8, 9, 2, 5])
5.2
Example 2: mean python code
>>> def my_mean(sample):
... return sum(sample) / len(sample)
...
>>> my_mean([4, 8, 6, 5, 3, 2, 8, 9, 2, 5])
5.2