# thread 函数

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

## 怎么写

### thread(call)

**call**

一个调用，其参数是长度相同的列表。接受一个表达式。

## 示例

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

  `thread(f([1, 2], [3, 4]))`

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

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

## 相关函数

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

  对多个列表中对应的元素应用一个函数。
- [total](https://zh.hilberon.com/library/total)

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

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

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

  列表的前几个元素。
- [accumulate](https://zh.hilberon.com/library/accumulate)

  列表的累计总和。

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