Python List: reverse() Method
reverse() Method
The reverse() method is used to reverse the elements of a given list.
Visual Explanation:

Syntax:
list.reverse()
Parameter Values: No parameters
Return Value: Doesn't return any value.
Example 1: Reverse a List
colors = ['Red', 'Green', 'Orange', 'Pink']
print("Original List:")
print(colors)
colors.reverse()
print('Updated List:', colors)
Output:
Original List: ['Red', 'Green', 'Orange', 'Pink'] Updated List: ['Pink', 'Orange', 'Green', 'Red']
Python Code Editor:
Previous: Python List remove() Method.
Next: Python List sort() Method
Test your Python skills with w3resource's quiz
- Weekly Trends
- Python Interview Questions and Answers: Comprehensive Guide
- Scala Exercises, Practice, Solution
- Kotlin Exercises practice with solution
- MongoDB Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - JOINS
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join