Python Tutorial Python Advanced Python References Python Libraries

Python List - reverse() Method



The Python 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