# 列表排序（Sort a list，sort）

按递增顺序排列的列表。

## 怎么写

### sort(list)

**list**

列表。接受一个列表。

## 示例

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

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

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

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

## 相关函数

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

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

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

  在一个或多个范围上求值表达式，构建列表。
- [rotate_right](https://zh.hilberon.com/library/rotate_right)

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

  列表的前几个元素。
- [rotate_left](https://zh.hilberon.com/library/rotate_left)

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

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