.reverse()

Reverse the elements in the list.

Syntax

list.reverse()

The .reverse() method does not take in any arguments.

Example 1

counting = [1, 2, 3, 4, 5]
counting.reverse()
print(counting)
# Output: [5, 4, 3, 2, 1]

Example 2

To reverse a list called hand:

Edit this page on GitHub

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your feedback.

Learn Python on Codecademy

Edit this page on GitHub

Contributors