Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

Sort a list (sort)

A list in increasing order.

How to write it

sort(list)

list
The list. Takes a list.

Examples

  • sort⁡([3,1,2])=[1,2,3]\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
  • subsets

    All the sublists of a list that keep its order, as a list.

  • select

    The elements of a list for which a test holds.

  • table

    Build a list by evaluating an expression over one or more ranges.

  • rotate_right

    A list with its elements moved to the right, the last ones going to the front.

  • take

    The first elements of a list.

  • rotate_left

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