take function
The first elements of a list.
How to write it
take(list, n)
- list
- The list. Takes a list.
- n
- How many elements. Takes a whole number.
Examples
take([1, 2, 3, 4], 2)In the solver,
Open in the solvertake([1, 2, 3, 4], 2)gives[1, 2].
Related functions
- tally
How often each element occurs: a list of element and count pairs.
- table
Build a list by evaluating an expression over one or more ranges.
- thread
Apply a function to corresponding elements of lists.
- subsets
All the sublists of a list that keep its order, as a list.
- total
Sum of the elements of a list.
- sort
A list in increasing order.