1. *args用法:python会将所有位置的参数收集到一个元组中
2. **args用法:python会将关键字参数传递给一个新的字典。**允许将关键字参数转换为字典
用法见如下代码:
def f(*args,**kwargs):
print(args)
print(kwargs)
f(1,2,4,nan='wbh',nv='cxx',)
(1, 2, 4)
{'nan': 'wbh', 'nv': 'cxx'}
就这样吧,今天也不想写,就这样糊弄糊弄吧!!