Using lists of lists in a function


Traceback (most recent call last):
File "python", line 14, in
File "python", line 6, in flatten
TypeError: object of type 'int' has no len()

Can anyone explain why I get this error? According to my understanding, in my code the variable 'numbers' is a list, but the error message is telling me it is an int?

Replace this line with your code.


def flatten(lists):
results = []
for numbers in range(0, len(lists)):
for y in range(0, len(numbers)):
return results


Sorry here is my code


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