For example, I have a function:
def foo(a, b, c):
pass
Now I have a dict:
d = {'a': 1, 'b': 2, 'c': 3}
I have to write something like:
foo(d['a'], d['b'], d['c'])
I’d like to know, could I just pass a collection of the arguments(like d) to the function?
Sure, you can pass a dict as
kwargs:Output: