How do I make a flat list out of a list of lists?
5.1k
I have a list of lists like [[1, 2, 3], [4, 5, 6], [7], [8, 9]]
. How can I flatten it to get [1, 2, 3, 4, 5, 6, 7, 8, 9]
?
python list comprehensions; compressing a list of lists? Flatten an irregular (arbitrarily nested) list of lists