Kodewick
Start learning →
Starter←→0 / 80

Long jump board

#040StarterSortingLists2 min

At sports day, long jumps are written down in centimetres in a list. Write longest_first(jumps) to return a new list sorted farthest first. No jumps gives [].

Examples
longest_first([312, 405, 388])→[405, 388, 312]
longest_first([])→[]
main.py
def longest_first(jumps):
    # your code here: sorted with reverse=True so the big ones come first
    ordered = jumps
    return ordered
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.