python find max in list of dict by value

Solutions on MaxInterview for python find max in list of dict by value by the best coders in the world

showing results for - "python find max in list of dict by value"
Lilly
04 Aug 2020
1lst = [{'price': 99, 'barcode': '2342355'}, {'price': 88, 'barcode': '2345566'}]
2
3maxPricedItem = max(lst, key=lambda x:x['price'])
4minPricedItem = min(lst, key=lambda x:x['price'])
5