The reverse method reverses the order of a list in place, changing the existing list rather than producing a separately described result. section 5.3
Use the method when the list itself should run from last element to first:
- Call it with list.reverse(). section 5.3
- It is a specialized list-modification operation, unlike slice assignment and other general editing techniques. section 5.3
- Do not confuse reverse() with reversed(): reversed returns an iterator and can traverse selected items without creating a new list. section 7.8.2
Reverse a list in place
x = [1, 3, 5, 6, 7] x.reverse() x [7, 6, 5, 3, 1]


