DEV Community

Ganesh Chandrasekaran
Ganesh Chandrasekaran

Posted on


How to sort tuples in Python ?

Tuples are immutable, but there is a simple way to sort them.

Convert the Tuple to List by using sorted function
then cast the List to Tuple.

Alt Text

Source : with lambda examples

Top comments (0)

🌚 Browsing with dark mode makes you a better developer.

It's a scientific fact.