跳转到内容

This page is also in English.

Read it in English

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

part 函数

按位置(从 1 开始计数)读取列表的一部分;也可写作 list[i]。

怎么写

part(list, i)

一个元素。

list
列表。接受一个列表。
i
位置。接受一个整数。

part(list, i, j)

列表的列表中的一个元素。

list
列表的列表。接受一个列表。
i
行。接受一个整数。
j
列。接受一个整数。

示例

  • part⁡([10,20,30],2)=20\displaystyle \operatorname{part}(\left[ 10, 20, 30 \right], 2) = 20
    part([10, 20, 30], 2)

    在求解器中,part([10, 20, 30], 2) 的结果是 20。

    在求解器中打开
  • part⁡((1234),2,1)=3\displaystyle \operatorname{part}\left(\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, 2, 1\right) = 3
    part([[1, 2], [3, 4]], 2, 1)

    在求解器中,part([[1, 2], [3, 4]], 2, 1) 的结果是 3。

    在求解器中打开
  • replace_part

    把某个位置上的部分替换后的列表;写作 position -> value。

  • partition

    将列表按给定长度拆分为若干块。

  • nest_list

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

  • position

    某个值在列表中出现的位置,以位置列表表示。

  • nest

    对一个值反复应用函数。

  • prepend

    在开头添加一个元素后的列表。