# first 函数

列表的第一个元素。

## 怎么写

### first(list)

**list**

列表。接受一个列表。

## 示例

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

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

  在求解器中，`first([1, 2, 3])` 的结果是 `1`。

  [在求解器中打开](https://zh.hilberon.com/?q=first%28%5B1%2C%202%2C%203%5D%29)

## 相关函数

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

  把嵌套列表展平为一个列表。
- [drop](https://zh.hilberon.com/library/drop)

  去掉开头若干元素后的列表。
- [fold](https://zh.hilberon.com/library/fold)

  从左侧开始，用函数把列表的元素逐步结合，并从某个值出发。
- [dimensions](https://zh.hilberon.com/library/dimensions)

  列表或矩阵的大小，逐层给出。
- [fold_list](https://zh.hilberon.com/library/fold_list)

  fold 的各个步骤：从初始值开始的每一个中间结果。
- [count](https://zh.hilberon.com/library/count)

  列表中有多少个元素等于某个值。

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