📜  python *args 和 **kwargs - 任何代码示例

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

代码示例4
def foo(*args):
    for a in args:
        print(a)        

foo(1)
# 1

foo(1,2,3)
# 1
# 2
# 3