← Code LabPython0/50 solved · 0%
Functions · medium

30. Sorting with multiple keys

Sort by more than one field.

Write `rank(trades)` sorting a list of dicts first by `"pair"` ascending, then by `"amount"` descending within each pair, returning the sorted list.
Required in your answer: sorted(key=