I have a list of dictionaries like so:
[{'price': 99, 'barcode': '2342355'}, {'price': 88, 'barcode': '2345566'}]
I want to find the min()
and max()
prices. Now, I can sort this easily enough using a key with a lambda expression (as found in another SO article), so if there is no other way I'm not stuck. However, from what I've seen there is almost always a direct way in Python, so this is an opportunity for me to learn a bit more.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…