# Reverse a list (reverse)

A list in reverse order.

## How to write it

### reverse(list)

**list**

The list. Takes a list.

## Examples

- $\displaystyle \operatorname{reverse}(\left[ 1, 2, 3 \right]) = \left[ 3, 2, 1 \right]$

  `reverse([1, 2, 3])`

  In the solver, `reverse([1, 2, 3])` gives `[3, 2, 1]`.

  [Open in the solver](https://hilberon.com/?q=reverse%28%5B1%2C%202%2C%203%5D%29)

## Related functions

- [riffle](https://hilberon.com/library/riffle)

  A list with a value put between its elements.
- [rest](https://hilberon.com/library/rest)

  A list without its first element.
- [rotate_left](https://hilberon.com/library/rotate_left)

  A list with its elements moved to the left, the first ones going to the end.
- [replace_part](https://hilberon.com/library/replace_part)

  A list with the part at a position replaced; write position -> value.
- [rotate_right](https://hilberon.com/library/rotate_right)

  A list with its elements moved to the right, the last ones going to the front.
- [range](https://hilberon.com/library/range)

  The whole numbers in a range, as a list.

---
Source: https://hilberon.com/library/reverse
