PythonListreverse
sort

reverseList

copy

Reverses the elements of the list in place.

Syntax

list.reverse()

Example

Enter values below to update the example in real time.

nums
print
nums = [1, 2, 3, 4, 5]
nums.reverse()
print(nums)  # [5, 4, 3, 2, 1]