先来看一个例子:
复制代码 代码如下:
def foo(*args, **kwargs):
print 'args =', args
print 'kwargs = ', kwargs
print '-----------------------'
if name == 'main':
foo(1, 2, 3, 4)
foo(a=1, b=2, c=3)
foo(1,2,3,4, a=1, b=2, c=3)
foo('a', 1, None, a=1, b='2', c=3)
Copyright© 2013-2020
All Rights Reserved 京ICP备2023019179号-8