# Sort a list (sort)

A list in increasing order.

## How to write it

### sort(list)

**list**

The list. Takes a list.

## Examples

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

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

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

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

## Related functions

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

  All the sublists of a list that keep its order, as a list.
- [select](https://hilberon.com/library/select)

  The elements of a list for which a test holds.
- [table](https://hilberon.com/library/table)

  Build a list by evaluating an expression over one or more ranges.
- [rotate_right](https://hilberon.com/library/rotate_right)

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

  The first elements of a list.
- [rotate_left](https://hilberon.com/library/rotate_left)

  A list with its elements moved to the left, the first ones going to the end.

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