Hello,

I think it would be nice to introduce an avg method for lists as a built-in 
function in python3.
To get average of the list, I need to use some libs (eg numpy).
In my opinion, if I can get sum of the list, I should get avg also in a same 
way.

For ex [python3]:

>>> l = [5, 9, 7,]
...
... import numpy as np
... print(np.mean(l))
7.0
>>> sum(l) / len(l)
7.0
>>> avg(l)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
NameError: name 'avg' is not defined


Cordialement/Regards
Kemal DIRI




_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/NQB6VU6QSC253JT2SWUO3IWCZ3IG36XP/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to