18/18 what is wrong with my code?


#1
n = [[1, 2, 3], [4, 5, 6, 7, 8, 9]]

def flatten(lists): 
  results = []
  for numbers in lists:
    for x in numbers:
      results.append(x)
  return results

print flatten(n)

File “python”, line 7
results.append(x)
^
IndentationError: unindent does not match any outer indentation level


#2

Check for mixed tabs and spaces, or simply clear all the indents and redo them with four spaces for each block level.


#3

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