Skip to content

Take

Take[list, m] returns the first m items of list.

Attributes[Take] := {NHoldRest, Protected}

Simple examples

Return the first two items in a list:

In[1]:= Take[{1, 2, 3, 4}, 2]
Out[1]= {1, 2}
Return a range from the middle of a list:
In[2]:= Take[{1, 2, 3, 4, 5}, {2, 4}]
Out[2]= {2, 3, 4}