📜  python代码示例中的args和kwargs是什么

📅  最后修改于: 2022-03-11 14:46:50.651000             🧑  作者: Mango

代码示例6
def mul(*args):  # args as argument
    multiply = 1
    for i in args:
        multiply *= i
        
    return multiply

lst = [4,4,4,4]
tpl = (4,4,4,4)    

print(mul(*lst))  # list unpacking
print(mul(*tpl)) # tuple unpacking