I have a function where I am returning two values. I would like to put the two values directly into two different arrays. I know how to return the output as two different values to be later added to the array, but I don't want to have the temporary place holders. An example is shown below.
def two_outputs():
output_one = 5
output_two = 6
return output_one, output_two
one_array = [] # initialize array
two_array = [] # initialize array
a, b = two_outputs() # get values
one_array.append(a) # store first value in first array
two_array.append(b) # store second value in first array
Ideally I would like to not use a and b and have to append at a later on in the code. I would like to append the output of the function directly to the two arrays. Is this even possible?
Thanks for any help. I hope I did this correctly as this is my first post. You guys have helped me quite a bit with programming issues already.
UPDATE: I guess based on the responses below that it is not possible to do this directly. Thanks for everyone's help in finding other ways to accomplish the goal.