# first function

The first element of a list.

## How to write it

### first(list)

**list**

The list. Takes a list.

## Examples

- $\displaystyle \operatorname{first}(\left[ 1, 2, 3 \right]) = 1$

  `first([1, 2, 3])`

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

  [Open in the solver](https://hilberon.com/?q=first%28%5B1%2C%202%2C%203%5D%29)

## Related functions

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

  Nested lists flattened into one list.
- [drop](https://hilberon.com/library/drop)

  A list without its first elements.
- [fold](https://hilberon.com/library/fold)

  Combine the elements of a list from the left with a function, starting from a value.
- [dimensions](https://hilberon.com/library/dimensions)

  The size of a list or a matrix, level by level.
- [fold_list](https://hilberon.com/library/fold_list)

  The steps of fold: every partial result, starting from the first value.
- [count](https://hilberon.com/library/count)

  How many elements of a list equal a value.

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