[Python] Sort a list in python

Discussão em 'Python' iniciado por Stack, Maio 6, 2025.

  1. Stack

    Stack Membro Participativo

    I have this list

    [1,-5,10,6,3,-4,-9]


    But now I want the list to be sorted like this:

    [10,-9,6,-5,-4,3,1]


    As you can see I want to order from high to low no matter what sign each number has, but keeping the sign, is it clear?

    Continue reading...

Compartilhe esta Página