variadic

Why does passing a dictionary as part of *args give us only the keys?

Why does passing a dictionary as part of *args give us only the keys? Question: The setup Let’s say I have a function: def variadic(*args, **kwargs): print("Positional:", args) print("Keyword:", kwargs) Just for experiment’s sake, I call it with the following: variadic({‘a’:5, ‘b’:’x’}, *{‘a’:4, ‘b’:’y’}, **{‘a’:3, ‘b’:’z’}) Output: Positional: ({‘a’: 5, ‘b’: ‘x’}, ‘a’, ‘b’) Keyword: …

Total answers: 1