def func(*args): print(args)
当用func(1,2,3)调用函数时,参数args就是元组(1,2,3)
2、** 则表示将调用函数时的关键字参数放入一个字典中;def func(**args): print(args)
当用func(a=1,b=2)调用函数时,参数args将会是字典{‘a’:1,‘b’:2}
二、函数调用中使用 1、*args表示将可迭代对象扩展为函数的参数列表args=(1,2,3) func=(*args)
等价于函数调用func(1,2,3)
2、**args表示将字典扩展为关键字参数args={'a':1,'b':2}
func(**args)
等价于函数调用 func(a=1,b=2)
参考资料:
python 操作符**与*的用法



