Python之求数组元素的平均值

Python 环境:Python 2.7.12 x64python IDE :     Wing IDE Professional  5.1.12-1数组 题目:  求数组元素的平均值code #求数组元素的平均值 a=[1,4,8,10,12] b=len(a) sum=0 print "数组长度为:",b for i in a: sum=sum+i print "均值为:",sum/
相关文章
相关标签/搜索