List reverse() method Python

The list reverse() method of python reverse the order of the elements.

 
>>> ls=[23 , 67 ,'Test' , 'New' , 90 , (90,) , [45]]
>>> ls.reverse()
>>> ls
[[45], (90,), 90, 'New', 'Test', 67, 23]

There is no other purpose of this function besides reversing the order of the elements.



Leave a Reply

Your email address will not be published. Required fields are marked *