cartn_append()

FunctionalX.src.lists._cartn_append.cartn_append(*list_of_lists: list) → list

Cartesian product of n lists.

The difference from cartn is that the first element of the input list_of_lists is itself a list of lists. The elements from other lists are appended (inserted) to each sub-list of the first list.

Parameters:list_of_lists(vararg) (list) – variable number of lists
Returns:a new list
Return type:list
>>> cartn_append([['a','b'],['c','d']], [1,2], ['A','B'])
[['a', 'b', 1, 'A'], ['a', 'b', 1, 'B'], ['a', 'b', 2, 'A'], ['a', 'b', 2, 'B'], ['c', 'd', 1, 'A'], ['c', 'd', 1, 'B'], ['c', 'd', 2, 'A'], ['c', 'd', 2, 'B']]