SyntaxFix
Write A Post
Hire A Developer
Questions
sort dictionary 'in_dict' by value in decreasing order
sorted_dict = {r: in_dict[r] for r in sorted(in_dict, key=in_dict.get, reverse=True)}
example above
sorted_d = {r: d[r] for r in sorted(d, key=d.get('key3'), reverse=True)}