我的代码为什么不行呢?
def average(*args):
sum=0
i=len(args)
for a in args:
sum=sum+a
return
sum=sum/i
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
def average(*args):
sum=0
i=len(args)
for a in args:
sum=sum+a
return
sum=sum/i
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
2016-02-06
举报