flatten a list of list python

flat_list = [item for sublist in l for item in sublist]

#which is equivalent to this 
flat_list = []
for sublist in l:
    for item in sublist:

Here is what the above code is Doing:
1. We create an empty list called flat_list.
2. We iterate over the outer list.
3. For each outer list element, we iterate over the inner list.
4. For each inner list element, we append it to flat_list.
5. We return flat_list.