How can I evaluate a value at a specific key in a dict when using that key
in a string variable (currency
) to get the underlying values? What I'm trying now is:
offer = {'USD': [0.12, 0.15, 0.20, 0,50]}
currency = ['USD']
print(offer[currency])
and I want that to give
>>> [0.12, 0.15, 0.20, 0,50]
Is there any function or method that I'm missing?