first function
The first element of a list.
How to write it
first(list)
- list
- The list. Takes a list.
Examples
first([1, 2, 3])In the solver,
Open in the solverfirst([1, 2, 3])gives1.
Related functions
- flatten
Nested lists flattened into one list.
- drop
A list without its first elements.
- fold
Combine the elements of a list from the left with a function, starting from a value.
- dimensions
The size of a list or a matrix, level by level.
- fold_list
The steps of fold: every partial result, starting from the first value.
- count
How many elements of a list equal a value.