slices a list into a sequence of sub-lists with the number of elements in each sub-list differing by at most one
ListTools[Slice]( L, n );
Slice( L, n );
Any list, to be sliced into sub-lists.
Positive integer, specifying the target number of sub-lists.
As the underlying implementation of the ListTools package is a module, it is also possible to use the form ListTools:-Slice to access the command from the package. For more information, see Module Members.
The command slices a list into a sequence of sub-lists with the number of elements in each sub-list differing by at most one.
If not all the sub-lists are of the same length, the longer lists appear first.
Elements in the returned sequence of sub-lists appear in the same order as the original list.
If the specified number of sub-lists is greater than the number of elements in the original list, then the list is sliced into sub-lists of single elements, followed by empty sub-lists.
The ListTools[Slice] command was introduced in Maple 2020.
For more information on Maple 2020 changes, see Updates in Maple 2020.
Download Help Document
What kind of issue would you like to report? (Optional)