This article introduces you to the method of finding the average of a list in Python. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.
How to find the average of a list in Python
How to find the average of a list when it only contains numbers Average:
from numpy import * a = [52,69,35,65,89,15,34] b = mean(a) print(b)
Running results:
51.285714285714285
Related free learning recommendations: python video tutorial!
The above is the detailed content of How to find the average of a list in Python. For more information, please follow other related articles on the PHP Chinese website!