AlphaCodingSkills

Python - List reverse() Method


Advertisements

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

Syntax


list.reverse()

Parameters

No parameter is required.

Example:

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

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

MyList.reverse() 
print(MyList)

Output

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

Lists Methods