# intersection 函数

同时属于若干个列表的所有元素。

## 怎么写

### intersection(a, b, ...)

**a**

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

**b**

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

## 示例

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

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

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

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

## 相关函数

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

  将多个列表合并为一个。
- [head](https://zh.hilberon.com/library/head)

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

  列表的最后一个元素。
- [fold_list](https://zh.hilberon.com/library/fold_list)

  fold 的各个步骤：从初始值开始的每一个中间结果。
- [length](https://zh.hilberon.com/library/length)

  列表中元素的个数。
- [fold](https://zh.hilberon.com/library/fold)

  从左侧开始，用函数把列表的元素逐步结合，并从某个值出发。

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