I'm using a function that manipulates values in certain way, based on the other values that I pass to it. Example
return foo(a,b)
>>> a_new, b_new
or
return foo(a,b,c)
>>> a_new, b_new, c_new
The function foo is part of a library that cannot be altered. The variables are generated in a loop a step earlier, and, therefore, are just part of a list. So currently, I'm passing the values manually:
return foo(variables[0], variables[1], variables[2])
>>> variables
This is quite a drag. How can I code it, so that all the entries in this list are just spelled out and separated by values? So basically a function:
def bar(variables):
???
return variables[0], variables[1], ... variables[len(variables)]
so I can just
return foo(bar(variables)
>>> variables