Sorting integer and string lists in Python

Publicado em: 17 Outubro 2022
no canal de: ExplainHowToSimply
1,132
10

This short Python tutorial shows how to sort integer and string lists in Python. A list is created as: example_list = [c, a, b] and can be sorted with following commands:
- sorted(example_list)
- example_list.sort()
To start with the biggest number or letter in the alphabet, we can use the argument; reverse=True within the sorted() function. To sort the letters regardless of lower- & uppercase, we can specify the key=str.lower within the sorted() function.

Many thanks for watching!


Nesta página do site você pode assistir ao vídeo on-line Sorting integer and string lists in Python duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário ExplainHowToSimply 17 Outubro 2022, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 1,132 vezes e gostou 10 espectadores. Boa visualização!