TakeList

TakeList[list,{n1,n2,}]

gives the list of results obtained by successively taking ni elements from list.

TakeList[list,{seq1,seq2,}]

successively uses the sequence specifications seqi.

TakeList[list,seqs1,seqs2,]

gives a nested list in which elements specified by the lists seqsi are taken at level i in list.

Details

Examples

open allclose all

Basic Examples  (5)

Take sublists of different lengths from a list of symbols:

In[1]:=
Click for copyable input
Out[1]=

Take sublists from the end:

In[1]:=
Click for copyable input
Out[1]=

Take two elements, then three elements, and then all the rest:

In[1]:=
Click for copyable input
Out[1]=

Take two elements, then three elements, and then up to 10 and five if present:

In[1]:=
Click for copyable input
Out[1]=

Take a list of subexpressions from an expression with any head:

In[1]:=
Click for copyable input
Out[1]=

Scope  (2)

Properties & Relations  (5)

See Also

Take  Drop  TakeDrop  Partition  UpTo  Part  Extract  FoldPairList  NumberDecompose

Introduced in 2017
(11.2)