Problem to calculate the mean in version 3.4

Paul Rubin at nospam.invalid
Fri Sep 25 09:12:05 CEST 2015

Michel Guirguis <guirguismichel at> writes:
>>>> mean([1, 2, 3, 4, 4])
> Traceback (most recent call last):...
> NameError: name 'mean' is not defined

Before you can use that function, you have to import the statistics
module, e.g.:

    >>> import statistics
    >>> statistics.mean([1,2,3,4,4])   


    >>> from statistics import mean
    >>> mean([1,2,3,4,4])

More information about the Python-list mailing list