# 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

- $\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](https://hilberon.com/?q=position%28%5B5%2C%206%2C%207%5D%2C%206%29)

## Related functions

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

  A list with an element added at the start.
- [partition](https://hilberon.com/library/partition)

  A list split into blocks of a given length.
- [range](https://hilberon.com/library/range)

  The whole numbers in a range, as a list.
- [part](https://hilberon.com/library/part)

  Read part of a list by position, counting from 1; also written list\[i\].
- [replace_part](https://hilberon.com/library/replace_part)

  A list with the part at a position replaced; write position -> value.
- [nest_list](https://hilberon.com/library/nest_list)

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

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