A Python-function foo(p, q) calculates four values a, b, c, and returns
return a, b, c, d
In the calling function I need an assignment like
(r, s, t, u) = (p, q, foo(p, q))
or
((r, s), (t, u)) = ((p, q), foo(p, q))
How does the code look like?
r, s, t, u, *_ = (p, q) + foo(p, q)would also work if you don't care aboutcanddthat's being returned.r, s, (*_, t, u) = (p, q, foo(p, q))to discardaandb.