18. error?


#1



https://www.codecademy.com/en/courses/python-beginner-nzzVa/4/2?curriculum_id=4f89dab3d788890003000096#


invalid syntax line 4


n = [[1, 2, 3], [4, 5, 6, 7, 8, 9]]
# Add your function here

define flatten(lists):
    results=[]
    for numbers in lists:
        print numbers
        for i in numbers:
            results.append(i)
return results



print flatten(n)


#2

here:

define flatten(lists):

you want a definition/function, the keyword for this is def (short for definition)


#3

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