Example i have a list like this:
my_list = [{'name': 'a', 'value': 1}, {'name': 'b', 'value': 3}, {'name': 'a', 'value': 4}, {'name': 'c', 'value': 4}]
I want to get the dict named 'a' and has the value of 4 in a fast way without using for-loop
This was my dummy code
for i in my_list: if i['name'] == 'a': if i['value'] == 4: print('found') break
and it seems to be hardcoding so i want to short it out