Sorting iterables PREMIUM

Series: Looping
Trey Hunner smiling in a t-shirt against a yellow wall
Trey Hunner
3 min. read 2 min. video Python 3.8—3.12

How can you sort things in Python?

The list sort method

Python's lists have a sort method, which will modify the list to order all of its items from smallest to largest:


A Python Tip Every Week

Need to fill-in gaps in your Python skills? I send weekly emails designed to do just that.