I'm hitting a problem I don't seem to be able to solve in my algorith.
Let's say I have:
which returns a 2 element tuple, and I also have
which I want to use that tuple on. But everytime I try to call it on function2 as
I get the error "missing 1 required positional argument:" because the function is receiving the tuple as:
How can I get it to do the latter?
* argument unpacking syntax:
Below is a demonstration:
>>> def func1(): ... return 1, 2 ... >>> def func2(a, b): ... return a + b ... >>> func2(*func1()) 3 >>>
Or, in simpler terms, doing this:
is equivalent to this: