I have the following variable:

```
Output=[{'name': 'AnnualIncome', 'value': 5.0},
 {'name': 'DebtToIncome', 'value': 5.0},
 {'name': 'Grade', 'value': 'A'},
 {'name': 'Home_Ownership', 'value': 'Rent'},
 {'name': 'ID', 'value': 'ID'},
 {'name': 'InitialListing_Status', 'value': 'f'},
 {'name': 'JointFlag', 'value': 0.0},
 {'name': 'LateFeeReceived_Total', 'value': 5.0},
 {'name': 'LoanAmount', 'value': 5.0},
 {'name': 'OpenCreditLines', 'value': 5.0},
 {'name': 'Strategy', 'value': 'Reject'},
 {'name': 'Term', 'value': '60 months'},
 {'name': 'TotalCreditLines', 'value': 5000.0}]

```

which is almost the output of my defined function. 

Without doubt, I know that the output of my function will always be JointFlag and Strategy. As for the other variables in Output, they may or may not exist (there may even be newer ones or in a different order!)

I heard that dictionary is a much better method than exec and I'm just curious to know how to approach this.

At the end of my defined function it will have the following string: 

```
return JointFlag, Strategy

```

Here is an exec command that I am currently using.

```py
def execute():
    #Some random codes which leads to Output variable

    for Variable in range(len(Outputs)):
        exec(f"{list(Outputs[Variable].values())[0]} = r'{list(Outputs[Variable].values())[1]}'")
    return JointFlag, Strategy

```