请问哪里错了谢谢
def average(*args):
m=0
sumN=0
if len(args)!=0:
for n in args:
sumN=sumN+n
m =m+1
return sumN*1.0 / m
else:
return 0.0
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
def average(*args):
m=0
sumN=0
if len(args)!=0:
for n in args:
sumN=sumN+n
m =m+1
return sumN*1.0 / m
else:
return 0.0
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
2016-02-04
举报