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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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