count = 0
total = 0
while True:
inp = raw_input ('enter a number:')
if inp == 'done' : break
if len(inp) < 1 : break
num = float(inp)
count = count + 1
total = total + num
print num, total, count
print "average:", total/count
我的打印输出没有显示出平均值,我错过了什么吗?没有得到的平均值
我正在使用python。 –
它显示我运行它时的平均值 –
你会得到什么?尝试使用数字1-5 – Jacobr365