Python Tutorial Python Advanced Python Resources Python Libraries
Python Java C++ C C# PHP R SQL DS Algo InterviewQ

Python - List reverse() Method



The Python list reverse() method is used to reverse order of all elements of the list.

Syntax

list.reverse()

Parameters

No parameter is required.

Return Value

None.

Example:

In the example below, reverse() method is used to reverse order of all elements of the list called MyList.

MyList = ['APR', 'MAR', 'FEB', 'JAN', ]

MyList.reverse() 
print(MyList)

The output of the above code will be:

['JAN', 'FEB', 'MAR', 'APR']

❮ Python List Methods




5