Skip to content

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

Léela en español

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

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

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])=1\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
  • 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.