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!
Sur cette page du site, vous pouvez voir la vidéo en ligne Sorting integer and string lists in Python durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur ExplainHowToSimply 17 octobre 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 1,132 fois et il a aimé 10 téléspectateurs. Bon visionnage!