如下所示,我没看出来我的有什么问题,希望各位指教
def average(*args):
if len(args)==None
return 0.0
sum=0.0
for i in args
sum=sum+i
return sum/len(args)
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
def average(*args):
if len(args)==None
return 0.0
sum=0.0
for i in args
sum=sum+i
return sum/len(args)
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
2017-02-13
举报