# append 函数

在末尾添加一个元素后的列表。

## 怎么写

### append(list, x)

**list**

列表。接受一个列表。

**x**

要添加的元素。接受一个表达式。

## 示例

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

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

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

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

## 相关函数

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

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

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

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

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

  由某个值的若干副本组成的列表。
- [total](https://zh.hilberon.com/library/total)

  列表元素之和。

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