In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article is a detailed introduction to "how python realizes array summation and average value". The content is detailed, the steps are clear, and the details are properly handled. I hope this article "how python realizes array summation and average value" can help you solve your doubts. Let's go deeper and learn new knowledge together with the ideas of Xiaobian.
array sum and average ls=[4,9,19,8,391,39,9,283,45]sum(ls)average=sum(ls)/len(ls)print ('accumulated value', sum(ls),'average', average) Find the average of the array elements
Python environment: Python 2.7.12 x64
IDE:Wing IDE Professional 5.1.12-1
Topic: Finding the Average Value of Array Elements
#Find the average of array elements a=[1,4,8,10,12]b=len(a)sum=0print "Array length is: ",bfor i in a: sum=sum+iprint "Mean is: ",sum/b
Read here, this article "python how to achieve array sum and average" article has been introduced, want to master the knowledge points of this article also need to be used by yourself to understand, if you want to know more about the relevant content of the article, welcome to pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.