Sorting integer and string lists in Python

Pubblicato il: 17 ottobre 2022
sul canale di: 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!


In questa pagina del sito puoi guardare il video online Sorting integer and string lists in Python della durata di ore minuti seconda in buona qualità , che l'utente ha caricato ExplainHowToSimply 17 ottobre 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,132 volte e gli è piaciuto 10 spettatori. Buona visione!