为什么结果对的总提示输出错误
def average(*args): x = 0 sum = 0 t = (args) n = len(t) if n == 0: return 0 else: while x < n: sum = sum + t[x] x = x + 1 n = float(n) return sum / n print average() print average(1, 2) print average(1, 2, 2, 3, 4)
为什么我这么写输出结果是对的,但是总提示我输出错误