# fold_list 函数

fold 的各个步骤：从初始值开始的每一个中间结果。

## 怎么写

### fold_list(f, start, list)

**f**

接受两个参数的函数。接受一个函数。

**start**

初始值。接受一个表达式。

**list**

要结合的元素。接受一个列表。

## 示例

- $\displaystyle \operatorname{fold\_list}(\operatorname{plus}, 0, \left[ 1, 2, 3 \right]) = \left[ 0, 1, 3, 6 \right]$

  `fold_list(plus, 0, [1, 2, 3])`

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

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

## 相关函数

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

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

  由参数构成的列表。
- [nest_list](https://zh.hilberon.com/library/nest_list)

  nest 的各个步骤：每次应用后的值，从第一次开始。
- [head](https://zh.hilberon.com/library/head)

  表达式的头部：它所调用的函数的名称。
- [intersection](https://zh.hilberon.com/library/intersection)

  同时属于若干个列表的所有元素。
- [flatten](https://zh.hilberon.com/library/flatten)

  把嵌套列表展平为一个列表。

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