Skip to content

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

Léela en español

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

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

position function

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

How to write it

position(list, x)

list
The list. Takes a list.
x
The value to look for. Takes an expression.

Examples

  • position⁡([5,6,7],6)=(2)\displaystyle \operatorname{position}(\left[ 5, 6, 7 \right], 6) = \begin{pmatrix} 2 \end{pmatrix}
    position([5, 6, 7], 6)

    In the solver, position([5, 6, 7], 6) gives [[2]].

    Open in the solver
  • prepend

    A list with an element added at the start.

  • partition

    A list split into blocks of a given length.

  • range

    The whole numbers in a range, as a list.

  • part

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

  • replace_part

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

  • nest_list

    The steps of nest: the value after each application, starting from the first.