Day 11 作业讲解

写函数,接收n个数字,求这些参数数字的和。(动态传参)

def func(*n):
    sum = 0
    for el in n:
        sum += el
    return sum

ret = func(1,2,5,4,7)

猜你喜欢

转载自www.cnblogs.com/xiaomai-rhce/p/10415490.html
今日推荐