哪儿错了?
def average(*args):
sum=0.0
if len (args)==0:
return sum
else:
for i in args:
sum=sum+i
return sum
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
def average(*args):
sum=0.0
if len (args)==0:
return sum
else:
for i in args:
sum=sum+i
return sum
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
2018-08-03
举报