# accumulate 函数

列表的累计总和。

## 怎么写

### accumulate(list)

**list**

列表。接受一个列表。

## 示例

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

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

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

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

## 相关函数

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

  在末尾添加一个元素后的列表。
- [union](https://zh.hilberon.com/library/union)

  出现在任意一个列表中的元素，每个只出现一次，按顺序。
- [apply](https://zh.hilberon.com/library/apply)

  把表达式的头部或列表的括号替换为函数。
- [total](https://zh.hilberon.com/library/total)

  列表元素之和。
- [complement](https://zh.hilberon.com/library/complement)

  某个列表中不在其他任何列表里的元素。
- [thread](https://zh.hilberon.com/library/thread)

  把函数应用到列表的对应元素上。

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