sum() 求和用法
1 def func(*args): 2 # sum = 0 3 # for el in args: 4 # sum += el 5 # return sum 6 return sum(args) # sum() 求和
def func(*args):
return sum(args)
1 def func(*args): 2 # sum = 0 3 # for el in args: 4 # sum += el 5 # return sum 6 return sum(args) # sum() 求和
def func(*args):
return sum(args)