I have a list of dictionaries and want each item to be sorted by a specific value.
Take into consideration the list:
[{'name':'Homer', 'age':39}, {'name':'Bart', 'age':10}]
When sorted by name
, it should become:
[{'name':'Bart', 'age':10}, {'name':'Homer', 'age':39}]
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…