Trier la liste des dictionnaires par clé Python
newlist = sorted(list_to_be_sorted, key=lambda k: k['name'])
Stupid Stork
newlist = sorted(list_to_be_sorted, key=lambda k: k['name'])
orders = {
'cappuccino': 54,
'latte': 56,
'espresso': 72,
'americano': 48,
'cortado': 41
}
sort_orders = sorted(orders.items(), key=lambda x: x[1], reverse=True)
for i in sort_orders:
print(i[0], i[1])