Python List reverse()

In this tutorial, we will see about Python List‘s reverse method.Python List reverse method is used to reverse the list.

Python List reverse example

You can simply call reverse method to reverse the list.
Let’s understand this with the help of simple example.

Output:

listOfItems: [‘Clock’, ‘Bed’, ‘Fan’, ‘Table’] listOfItems in reversed order: [‘Table’, ‘Fan’, ‘Bed’, ‘Clock’]

As you can see here, list got reversed using reverse method.
There are other ways to reverse the list. You can use slicing to reverse a list.

Output:

listOfItems: [‘Clock’, ‘Bed’, ‘Fan’, ‘Table’] listOfItems in reversed order: [‘Table’, ‘Fan’, ‘Bed’, ‘Clock’]

If you just want to traverse in reverse order, you can use reversed function too.

Output:

Table
Fan
Bed
Clock

That’s all about Python List reverse method.

Was this post helpful?

Leave a Reply

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