# union 函数

出现在任意一个列表中的元素，每个只出现一次，按顺序。

## 怎么写

### union(a, b, ...)

**a**

一个列表。接受一个列表。

**b**

一个列表。接受一个列表。

## 示例

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

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

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

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

## 相关函数

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

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

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

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

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

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

  每个元素出现的次数：元素与计数对的列表。

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