Reverse a list (reverse)
A list in reverse order.
How to write it
reverse(list)
- list
- The list. Takes a list.
Examples
reverse([1, 2, 3])In the solver,
Open in the solverreverse([1, 2, 3])gives[3, 2, 1].
Related functions
- riffle
A list with a value put between its elements.
- rest
A list without its first element.
- rotate_left
A list with its elements moved to the left, the first ones going to the end.
- replace_part
A list with the part at a position replaced; write position -> value.
- rotate_right
A list with its elements moved to the right, the last ones going to the front.
- range
The whole numbers in a range, as a list.