Skip to content

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

Léela en español

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

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

Reverse a list (reverse)

A list in reverse order.

How to write it

reverse(list)

list
The list. Takes a list.

Examples

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

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

    Open in the solver
  • riffle

    A list with a value put between its elements.

  • rest

    A list without its first element.

  • rotate_left

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

  • replace_part

    A list with the part at a position replaced; write position -> value.

  • rotate_right

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

  • range

    The whole numbers in a range, as a list.