写函数,接收n个数字,求这些参数数字的和

时间:2020-06-20 00:00:38   收藏:0   阅读:602
技术分享图片
1 def sum_func(*args):
2     total=0
3     for i in args:
4     return total
5 print(sum_func(1,2,3,8,23,6))
View Code

 

原文:https://www.cnblogs.com/qsmyjz/p/13166826.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!