Real Python Tutorials

How to Use sorted() and sort() in Python
NEW

How to Use sorted() and .sort() in Python

In this tutorial, you'll learn how to sort various types of data in different data structures in Python. You'll explore custom sorting orders and work with two distinct ways of sorting.

Feb 24, 2025 basics python