len(d)到底是多少,d可以是list,tuple,set,dict,,这个len()返回的是长度吗,有的时候好像是长度-1???
d = { 'Adam': 95, 'Lisa': 85, 'Bart': 59, 'Paul': 74 }
sum = 0.0
for score in d.itervalues():
print score
sum+=score
print sum/len(d)
d = { 'Adam': 95, 'Lisa': 85, 'Bart': 59, 'Paul': 74 }
sum = 0.0
for score in d.itervalues():
print score
sum+=score
print sum/len(d)
2018-07-23
举报