Python List reverse()

This tutorial shows you everything you need to know to help you master the essential reverse() method of the most fundamental container data type in the Python programming language.

Definition and Usage:

The list.reverse() reverses the order of the elements in the list. If you want to create a new list with reversed elements, use slicing with negative step size list[::-1].

Here’s a short example:

>>> lst = [1, 2, 3, 4]
>>> lst.reverse()
>>> lst
[4, 3, 2, 1]

In the first line of the example, you create the list lst. You then reverse the order of the elements in the list and print it to

Continue reading the original article