python核心编程第二版 2.9题目

题目描述;键入5个数,求其平均值。

total = 0
for i in range(0,5):
    a =float(raw_input('please input number %d:' %(i+1)))
    total = total + a
print 'the average is %f' %(total/5)

猜你喜欢

转载自blog.csdn.net/qq_37599517/article/details/81060078