Sorting Lists In Python

Publicado em: 08 Março 2021
no canal de: Dubious Code
173
0

Sorting lists in Python is something that you will do all the time. A basic list sort can be done with a .sort(). You also have options to do a reverse sort, and to provide a key to sort by something other than the first element.

Since python sorts are stable, if you sort by item 2 and then item 1, item 2 will act as a tie breaker in the cases where the list would have equivalent item 1's


All code

Copyright 2021 Google LLC
SPDX-License-Identifier: Apache-2.0
https://www.apache.org/licenses/LICEN...

The Snake image in the thumbnail - by Vecteezy https://www.vecteezy.com/vector-art/4...


Nesta página do site você pode assistir ao vídeo on-line Sorting Lists In Python duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Dubious Code 08 Março 2021, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 173 vezes e gostou 0 espectadores. Boa visualização!