Sorting integer and string lists in Python

Published: 17 October 2022
on channel: 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!


On this page of the site you can watch the video online Sorting integer and string lists in Python with a duration of hours minute second in good quality, which was uploaded by the user ExplainHowToSimply 17 October 2022, share the link with friends and acquaintances, this video has already been watched 1,132 times on youtube and it was liked by 10 viewers. Enjoy your viewing!