How to find the average of a list in Python

醉折花枝作酒筹
Release: 2021-04-27 09:21:05
forward
20266 people have browsed it

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 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)
Copy after login

Running results:

51.285714285714285
Copy after login

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!