L = [75, 92, 59, 68, 99] //定义变量L
sum = 0.0 //定义变量sum并初始化为浮点数
for a in L: //for循环取出L的值给a
sum = sum +a //循环为变量sum加L中取出的值
avg = sum/len(L) //定义avg为平均值并将sum最后for循环的相加结果除以L变量的长度
print(avg) //输出变量avg最后的平均值结果
L = [75, 92, 59, 68, 99] avg = 0.0 for item in L: avg += item avg /= len(L) print(avg)