# part function

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

## How to write it

### part(list, i)

One element.

**list**

The list. Takes a list.

**i**

The position. Takes a whole number.

### part(list, i, j)

An element of a list of lists.

**list**

A list of lists. Takes a list.

**i**

The row. Takes a whole number.

**j**

The column. Takes a whole number.

## Examples

- $\displaystyle \operatorname{part}(\left[ 10, 20, 30 \right], 2) = 20$

  `part([10, 20, 30], 2)`

  In the solver, `part([10, 20, 30], 2)` gives `20`.

  [Open in the solver](https://hilberon.com/?q=part%28%5B10%2C%2020%2C%2030%5D%2C%202%29)
- $\displaystyle \operatorname{part}\left(\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, 2, 1\right) = 3$

  `part([[1, 2], [3, 4]], 2, 1)`

  In the solver, `part([[1, 2], [3, 4]], 2, 1)` gives `3`.

  [Open in the solver](https://hilberon.com/?q=part%28%5B%5B1%2C%202%5D%2C%20%5B3%2C%204%5D%5D%2C%202%2C%201%29)

## Related functions

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

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

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

  The steps of nest: the value after each application, starting from the first.
- [position](https://hilberon.com/library/position)

  Where a value occurs in a list, as a list of positions.
- [nest](https://hilberon.com/library/nest)

  Apply a function again and again to a value.
- [prepend](https://hilberon.com/library/prepend)

  A list with an element added at the start.

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