Код: Выделить всё
lst = [{'fruit': 'apple', 'qty':'4', 'color': 'green'},
{'fruit': 'orange', 'qty':'6', 'color': 'orange'},
{'fruit': 'melon', 'qty':'2', 'color': 'yellow'}]
Я пробовал:
Код: Выделить всё
any(fruits['color'] == 'yellow' for fruits in lst)
Подробнее здесь: https://stackoverflow.com/questions/263 ... t-of-dicts