Whats wrong?


#1



Replace this line with your code. 
n = [[1, 2, 3], [4, 5, 6, 7, 8, 9]]
# Add your function here
def flatten(lists):
    results = []
    for numbers in lists:
        for i in numbers:
            results.append(i)
        return results    
    
print flatten(n)


#2

a function ends the moment a return keyword is reached.

this loop:

for numbers in lists

will only run once, since in the first iteration of this loop, a return keyword is reached

you might want to change the indent of return so both loops can run completely


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.