为什么程序显示错误?
def average(*args):
sum=0.0
x=0.0
n=len(args)
for x in args:
sum=sum+x
print sum/n
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
def average(*args):
sum=0.0
x=0.0
n=len(args)
for x in args:
sum=sum+x
print sum/n
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
2018-07-23
举报