为什么打印结果多出三行None?请指教
def average(*args):
sum = 0.0
if len(args) == 0:
print sum
else:
for i in args:
sum += i
print sum/len(args)
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
打印结果:
0.0
None
1.5
None
2.4
None
为什么会多出三行None?请大神指教