写函数,接收n个数字,求这些参数数字的和。(动态传参)
def func(*n): sum = 0 for el in n: sum += el return sum ret = func(1,2,5,4,7)
写函数,接收n个数字,求这些参数数字的和。(动态传参)
def func(*n): sum = 0 for el in n: sum += el return sum ret = func(1,2,5,4,7)
转载于:https://www.cnblogs.com/xiaomai-rhce/p/10415490.html