I came across this code:
[item for sublist in non_empty_lists for item in sublist]
But I don’t really understand what it does. non_empty_lists
is a list of lists.
I understand it basically “flattens” the list. But I don’t really get the syntax. Could you please give me a hint of the algorithm behind this list comprehension?