# 列表反转（Reverse a list，reverse）

逆序排列的列表。

## 怎么写

### reverse(list)

**list**

列表。接受一个列表。

## 示例

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

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

  在求解器中，`reverse([1, 2, 3])` 的结果是 `[3, 2, 1]`。

  [在求解器中打开](https://zh.hilberon.com/?q=reverse%28%5B1%2C%202%2C%203%5D%29)

## 相关函数

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

  在元素之间插入某个值后的列表。
- [rest](https://zh.hilberon.com/library/rest)

  去掉第一个元素后的列表。
- [rotate_left](https://zh.hilberon.com/library/rotate_left)

  列表的元素向左移动，开头的元素移到末尾。
- [replace_part](https://zh.hilberon.com/library/replace_part)

  把某个位置上的部分替换后的列表；写作 position -> value。
- [rotate_right](https://zh.hilberon.com/library/rotate_right)

  列表的元素向右移动，末尾的元素移到开头。
- [range](https://zh.hilberon.com/library/range)

  某个范围内的整数，以列表形式给出。

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