Skip to content
Loading
How to reverse tuple elements without using function
  • Sachin Singh
    Tuples are immutable, so by creating a copy, we can reverse it.
    1. def Reverse(tuples):  
    2.     new_tup = tuples[::-1]  
    3.     return new_tup  
    4.         
    5. tuples = (1,2,3,4,5,6,7,8,9)  
    6. print(Reverse(tuples))