Why isn't it working?


#1



n = [[1, 2, 3], [4, 5, 6, 7, 8, 9]]
# Add your function here
def flatten(lists):
    results = ""
    for numbers in lists:
        for number in numbers:
            results.append(number)
    return results        



print flatten(n)


#2

Right now, "results" is a string, so you can not append anything to it. Make "results" a list.


#3

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