FLAT
The function FLAT takes a list of lists and returns a new list with the items contained in each sub-list.
This function takes a List containing items of any type and returns a new list by "flattening" any nested lists into the resulting list. For each item in the list that is a list itself, each item in the sub-list will be added to the final list. Any items that are not of the list type are passed along into the final list.
Declaration
Parameters
input_list (type: list)
Any list of items.
Return Values
flattened_list (type: list)
A list created by unwrapping any nested sub-lists into the final list.
Examples
The most common way to use the FLAT function is to produce a single-level list from a list of lists.
If there are items in the input_list that are not lists themselves, they will appear un-modified in the final list.
The FLAT function only removes a single level of nesting, when provided a list of lists of lists, the result will be a list of lists.
Last updated