how to create a single list from a list of lists in django code example
Example 1: flatten a list of lists python
flattened = [val for sublist in list_of_lists for val in sublist]
Example 2: python flatten list
itertools.chain.from_iterable(factors)