这样为啥不对啊,求大佬
这样为啥不对啊 def average(*args): sum=0.0 n=0 if len(args)==0: return 0 for x in args: sum=sum+x n=n+1 return sum/n print average() print average(1, 2) print average(1, 2, 2, 3, 4)
这样为啥不对啊 def average(*args): sum=0.0 n=0 if len(args)==0: return 0 for x in args: sum=sum+x n=n+1 return sum/n print average() print average(1, 2) print average(1, 2, 2, 3, 4)
2018-03-09
举报