标签:highlight python name func enter lex strong nbsp ext
def func(*args, **kwargs): print(args) print(kwargs) l1 = [1, 2, 3] d1 = {‘name‘: ‘alex‘, ‘age‘: 48} func(l1, d1) func(*l1,**d1) #相当于 func(1,2,3,name=‘alex‘,age=‘48‘)
结果:
([1, 2, 3], {‘name‘: ‘alex‘, ‘age‘: 48}) {} (1, 2, 3) {‘name‘: ‘alex‘, ‘age‘: 48}
标签:highlight python name func enter lex strong nbsp ext
原文地址:https://www.cnblogs.com/mainstream/p/11073408.html