THE WORLD'S LARGEST WEB DEVELOPER SITE

Python List reverse() Method

❮ List Methods


Example

Reverse the order of the fruit list:

fruits = ['apple', 'banana', 'cherry']

fruits.reverse()
Run example »

Definition and Usage

The reverse() method reverses the sorting order of the elements.


Syntax

list.reverse()

Parameter Values

No parameters


Related Pages

The buil-in function reversed() returns a reversed iterator object.


❮ List Methods