为什么这里的return不需要啊?求解
d = { 'Adam': 95, 'Lisa': 85, 'Bart': 59, 'Paul': 74 }
sum = 0.0
for a in d.values():
sum=sum+a
average=sum/len(d)
return average
print average
d = { 'Adam': 95, 'Lisa': 85, 'Bart': 59, 'Paul': 74 }
sum = 0.0
for a in d.values():
sum=sum+a
average=sum/len(d)
return average
print average
2019-01-11
举报