How to Sort a List of Tuples in Python: There’s More Than One Way

Do you have to sort a list of tuples in your Python program? Are you trying to figure out if you should use sorted() or sort()? You are in the right place.

The first way to sort a list of tuples is by using the Python sorted() function that returns a new sorted list of tuples. An alternative is the list sort() method that doesn’t return a new list but