reverse a tuple in python code example
Example 1: reverse a tuple python
>>> x = (1, 2, 3, 4)
>>> x = tuple(reversed(x))
>>> x
(4, 3, 2, 1)
Example 2: reverse a list in python
list.reverse()
>>> x = (1, 2, 3, 4)
>>> x = tuple(reversed(x))
>>> x
(4, 3, 2, 1)
list.reverse()