L = [75, 92, 59, 68, 99] for a in L: sum = 0 sum = sum + a print (sum / 5)
L = [75, 92, 59, 68, 99]
for a in L:
sum = 0
sum = sum + a
print (sum / 5)
为什么这样的答案算出来就是19呢?
L = [75, 92, 59, 68, 99]
sum = 0
for a in L:
sum = sum + a
print (sum / 5)
这样输就正常的,是放在for里面就不循环吗