Sort Nested Dictionary By Key Or By Value In Python: One Liner

How do you sort a nested dictionary in Python by key or by value? Throughout this article, I will use the following example, which displays a nested dictionary that contains three main properties labelled dict1, dict2, dict3 and from each key they reference another dictionary which contains a simple dictionary of three keys labelled A, B and C with each key matched to the same value 1, 2 and 3: ...

5 min · 953 words · Ryan Sheehy