# total 函数

列表元素之和。

## 怎么写

### total(list)

**list**

列表。接受一个列表。

## 示例

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

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

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

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

## 相关函数

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

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

  把函数应用到列表的对应元素上。
- [accumulate](https://zh.hilberon.com/library/accumulate)

  列表的累计总和。
- [tally](https://zh.hilberon.com/library/tally)

  每个元素出现的次数：元素与计数对的列表。
- [append](https://zh.hilberon.com/library/append)

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

  列表的前几个元素。

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