list.reverse
Reverse the list in place.
Python 3.13
list.reverse()Return value
Nothing (None); the list is reversed in place.
Examples
Reversing a list in place
Python 3.13
a = [1, 2, 3]
a.reverse()
print(a)[3, 2, 1]
The method returns None
Python 3.13
a = [1, 2, 3]
print(a.reverse())
print(a)None [3, 2, 1]
Details
To get a reversed copy without changing the list, use the slice a[::-1] or reversed.
