def sum_fun(*args):
sum = 0
for i in args:
sum += i
return sum
print(sum_fun(1, 2, 3, 4, 5))
1.写函数,接受n个数字,求这些参数数字的和
最新推荐文章于 2024-06-06 14:48:48 发布
def sum_fun(*args):
sum = 0
for i in args:
sum += i
return sum
print(sum_fun(1, 2, 3, 4, 5))