I think there is misunderstanding.
if you call the function with [something like] list or dict you either unpack it during the call (in effect passing individual elements) or you will end up with 2 arguments in boo tuple and empty dict:
boo
will be a tuple, hoo
will be a dict.if you call the function with [something like] list or dict you either unpack it during the call (in effect passing individual elements) or you will end up with 2 arguments in boo tuple and empty dict:
def foo(*boo, **hoo): print(type(boo), boo) print(type(hoo), hoo) spam = [1, 2] eggs = {'a':3, 'b':4} foo(*spam, **eggs) foo(spam, eggs) foo(5, 6, c=7, d=8)
Output:<class 'tuple'> (1, 2)
<class 'dict'> {'a': 3, 'b': 4}
<class 'tuple'> ([1, 2], {'a': 3, 'b': 4})
<class 'dict'> {}
<class 'tuple'> (5, 6)
<class 'dict'> {'c': 7, 'd': 8}
the idea is to allow having variable number of positional (*args) or keyword (**kwargs) arguments. *args and **kwargs is conventional way to name these.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs