This may sound like a newbie question, but I really need help. I don’t even know how to tag it, but I guess this is just a Python question. I need to use a function that takes 5 parameters and returns 5 values:
a, b, c, d, e = function (input1, input2, input3, input4, input5)
The problem is that when I use the full names of variables / functions, the line is too long and the code looks ugly, I want to use a more fancy solution here, and I thought about using a dict or list, so I can do this:
input_dict['param1'] = input1 input_dict['param2'] = input2 input_dict['param3'] = input3 input_dict['param4'] = input4 input_dict['param5'] = input5 ret_dict = function(input_dict)
Is there a better or “pythonic” way to improve the quality of the code for this kind of call?
Thanks in advance!
source share