I have a list of variables that I want to send to my function. (so the function works based on the values on those variables).
One way is to pass each variable separately in the function like this:
def my_function(var1, var2, var3, var4, ..., varn):
output = var1 + var2 + var3 + var4 + .... + varn
However, I wonder if I can write such a thing:
def my_function(parameters):
output = parameters.var1 + parameters.var2 + ... + parameters.varn
That is, somehow is there any way to wrap all variables in one variable, and then call them like this?
I know the above python codes are not correct, I just want to express my question.
Thanks in advance