SQLDAXExcelPython
Leaderboard
Core PythonEasy10 points

Sort a dictionary by value

Complete keys_by_value(totals) so it returns the keys ordered from the highest value to the lowest.

How your answer is tested

After your code, this runs and its result is checked:

result = keys_by_value({"North": 5, "South": 12, "East": 1, "West": 7})
Show solutionLifetime

Real Python running in your browser through Pyodide, with pandas available. Nothing you type is sent to a server unless you save a score.

Python
Loading editor…

Press Ctrl+Enter or Run to see the result here.