这个代码为什么不能用?len(d.itervalues())出错
d = { 'Adam': 95, 'Lisa': 85, 'Bart': 59, 'Paul': 74 }
sum = 0.0
for v in d.itervalues():
sum = sum + v
print sum / len(d.itervalues())
d = { 'Adam': 95, 'Lisa': 85, 'Bart': 59, 'Paul': 74 }
sum = 0.0
for v in d.itervalues():
sum = sum + v
print sum / len(d.itervalues())
2020-04-21
举报