为什么不能这样写呢 求大佬赐教
def average(*args):
n = len(args)
if n == 0:
return 0.0
else:
return float(sum(args)/n)
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
def average(*args):
n = len(args)
if n == 0:
return 0.0
else:
return float(sum(args)/n)
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
2020-04-24
举报