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

Discussion (0)