18. using a list of lists in a function


I wrote the code but the program throws an error at execution: ‘return’ outside function. If I start putting spaces (Tab), then the error changes to: line 9 return results
IndentationError: unexpected indent
What’s wrong?


so this is currently your function + content:

def flatten(lists):
    results = []

the for loop isn’t part of the function content/body, why not?


Thankэs it helped to solve the problem


good, that was the intention :slight_smile: well done solving it with just a nudge in the right direction :slight_smile:


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