I am trying to flatten a list using list comprehension in python. My list is somewhat like
[[1, 2, 3], [4, 5, 6], 7, 8]
just for printing
No-one has given the usual answer:
def flat(l): return [y for x in l for y in x]
There are dupes of this question floating around StackOverflow.