The problem I got, is the following: I got JSON-Data which I already converted to a dictionary. The JSON-Data looks like this:
[{"text": "foo1", "value": 1},
{"text": "foo2", "value": 2}]
So my converted json in Python is
json = [{'text': 'foo1', 'value': 1}, {'text': 'foo2', 'value': 2}].
The text in these dictionaries is random data and can be swapped for anything the value on the other hand can be interpreted as a fix and unique ID from 1 to infinity.
Now my question is what would possible be the most efficient way of getting out the text.
Because what I tried was
foo1 = [v['text'] for v in json if json['value'] == 1][0] # and
foo2 = {list(v.values())[1]: list(v.values())[0] for v in json}[2]
though I have to admit that I am not really happy with these solutions...