How to sort a tuple in Python

How to sort elements of a tuple?
Python tuples do not have the sort method. So, to sort the elements of a tuple, the sorted builtin function can be used by passing the tuple as the argument. The function returns a list with the items of tuple sorted in ascending order. This list can be converted into a tuple by using tuple( ). The default sorting order is ascending order.
tup_raw = (7, 2, 5, 4)
result = sorted(tup_raw)
tup_sorted = tuple(result)
print('Sorted Tuple :', tup_sorted)
Sorted Tuple : (2, 4, 5, 7)

The reverse=True parameter sorts the items in descending order.
tup_raw = (7, 2, 5, 4)
result = sorted(tup_raw, reverse=True)
tup_sorted = tuple(result)
print('Sorted Tuple :', tup_sorted)
Sorted Tuple : (7, 5, 4, 2)
gk