江西财经大学2学位python第7次实验
(1)完成教材P163微实例9“基本统计值的计算”程序。
#注意输入格式为 : 99,98,97,96,95
from math import sqrt
def getNum():
nums = []
iNumStr = input("请输入数字:").split(',')
L = list(map(int,iNumStr))
return L
# 计算平均值
def mean(numbers): #
sum1 = 0
for i in numbers:
sum1 = sum1 + i
mean_1 = sum1 / len(numbers)
return mean_1
# 计算标准差
def dev(numbers,mean):
sum2 = 0
for i in numbers:
sum2 = (i -