Skip to content

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

Léela en español

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

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

prepend function

A list with an element added at the start.

How to write it

prepend(list, x)

list
The list. Takes a list.
x
The element to add. Takes an expression.

Examples

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

    In the solver, prepend([1, 2], 0) gives [0, 1, 2].

    Open in the solver
  • range

    The whole numbers in a range, as a list.

  • position

    Where a value occurs in a list, as a list of positions.

  • replace_part

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

  • partition

    A list split into blocks of a given length.

  • rest

    A list without its first element.

  • part

    Read part of a list by position, counting from 1; also written list[i].