From b202f2f4337ae733568cca0c94a9746ccf1d63db Mon Sep 17 00:00:00 2001 From: Isabelle Viktoria Maciohsek Date: Fri, 8 Jan 2021 00:56:50 +0200 Subject: [PATCH] Update sort_dict_by_value.md --- snippets/sort_dict_by_value.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/sort_dict_by_value.md b/snippets/sort_dict_by_value.md index f2224a186..9bcd0d6f5 100644 --- a/snippets/sort_dict_by_value.md +++ b/snippets/sort_dict_by_value.md @@ -3,7 +3,7 @@ title: sort_dict_by_value tags: dictionary,intermediate --- -Sorts the given dictionary by key. +Sorts the given dictionary by value. - Use `dict.items()` to get a list of tuple pairs from `d` and sort it using a lambda function and `sorted()`. - Use `dict()` to convert the sorted list back to a dictionary.