A list of lists


#1



Please help


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 numbers in numbers:
            results.append(numbers)
        return results


print flatten(n)


#2

Hi @mzrickers ,

Is this statement intended to be within or outside one or both of the for loops, and is its indentation consistent with the actual intent? ...

return results

#3

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