# rotate_right 函数

列表的元素向右移动，末尾的元素移到开头。

## 怎么写

### rotate_right(list)

**list**

列表。接受一个列表。

## 示例

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

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

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

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

## 相关函数

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

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

  列表中满足某个测试的元素。
- [sort](https://zh.hilberon.com/library/sort)

  按递增顺序排列的列表。
- [riffle](https://zh.hilberon.com/library/riffle)

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

  列表所有保持顺序的子列表，以列表形式给出。
- [reverse](https://zh.hilberon.com/library/reverse)

  逆序排列的列表。

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