18/18 issues


Could someone help me? I've looked around the forums but I still have no idea what I am doing wrong.

n = [[1, 2, 3], [4, 5, 6, 7, 8, 9]]

def flatten(lists):
    results = []
    for number in lists:
        for i in lists:
    return results

print flatten(n)

Thanks :slightly_smiling:


My best guess without knowing the error thrown would be to change for i in lists: to for i in number:

Can you guess why?


Thin line

represents each list in the target list(you call it number). Now you want yo go through each of those list hence this line

should rather be

for i in number

Ohh i i guess @gaurangtandon has already provided an answer :grinning:


We both posted at exactly the same time :stuck_out_tongue:


Thanks that really helped :sweat_smile: