不定长参数,传入参数为列表,字典。如何进行转换?
def f(*args): print(args) f(*[1,2,3]) def k(**kwargs): print(kwargs) k(**{'name':'qin','job':'IT'})
打印结果:
(1, 2, 3) {'name': 'qin', 'job': 'IT'}