为什么这样答案还是错的
def average(*args):
s=0.0
n=1.0
for x in args:
s=s+x
n=n+1.0
return s/n
print average()
print average(1.0, 2.0)
print average(1, 2, 2, 3, 4)
def average(*args):
s=0.0
n=1.0
for x in args:
s=s+x
n=n+1.0
return s/n
print average()
print average(1.0, 2.0)
print average(1, 2, 2, 3, 4)
2020-04-29
举报