为什么不是浮点型
def average(*args):
b=0.00
if len(args)!=0:
print len(args)
print sum(a for a in args)
b=sum(a for a in args) / len(args)
return b
return 0
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
def average(*args):
b=0.00
if len(args)!=0:
print len(args)
print sum(a for a in args)
b=sum(a for a in args) / len(args)
return b
return 0
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
2019-04-12
举报