为什么不能引入自带的sum 函数???
求大神解答
import math
def average(*args):
if len(args) == 0:
return
x = math.sum(args)
y = x / len(args)
return y
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
求大神解答
import math
def average(*args):
if len(args) == 0:
return
x = math.sum(args)
y = x / len(args)
return y
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
2018-07-13
举报