结果好像不太对,为啥出来了4个值
>>> L = [75, 92, 59, 68] >>> sum = 0.0 >>> for x in L: ... sum = sum + x ... print sum / 4 ... 18.75 41.75 56.5 73.5 >>>
>>> L = [75, 92, 59, 68] >>> sum = 0.0 >>> for x in L: ... sum = sum + x ... print sum / 4 ... 18.75 41.75 56.5 73.5 >>>
2016-04-11
举报