# map_thread 函数

对多个列表中对应的元素应用一个函数。

## 怎么写

### map_thread(f, lists)

**f**

要应用的函数。接受一个函数。

**lists**

由等长列表构成的列表。接受一个列表。

## 示例

- $\displaystyle \operatorname{map\_thread}\left(\operatorname{plus}, \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}\right) = \left[ 4, 6 \right]$

  `map_thread(plus, [[1, 2], [3, 4]])`

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

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

## 相关函数

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

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

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

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

  对一个值反复应用函数。
- [list](https://zh.hilberon.com/library/list)

  由参数构成的列表。
- [nest_list](https://zh.hilberon.com/library/nest_list)

  nest 的各个步骤：每次应用后的值，从第一次开始。

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