Difference call function with asterisk parameter and without
问题 I know what the meaning of an asterisk is in a function definition in Python. I often, though, see asterisks for calls to functions with parameters like: def foo(*args, **kwargs): first_func(args, kwargs) second_func(*args, **kwargs) What is the difference between the first and the second function call? 回答1: Let args = [1,2,3] : func(*args) == func(1,2,3) - variables are unpacked out of list (or any other sequence type) as parameters func(args) == func([1,2,3]) - the list is passed Let kwargs