So I have a function that returns a dictionary. The problem is that I want to assign the values of the dictionary to multiple variables, so I have to run the function several times. Is there a way to do this running the function only one time? Is there any elegant way to do this?
def myFunction():
a=1
b=2
c=3
d=4
df_out={"a":a, "b":b,"c":c,"d":d}
a1=myFunction()["a"]
b1=myFunction()["b"]
c1=myFunction()["c"]
d1=myFunction()["d"]
Thanks in advance!