List and Functions


#1

hi!
someone can explain me why I can’t use the range(len(lists))

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

print flatten(n)


#2
def flatten(lists):
    results = []
    for i in range(len(lists)):
        for j in lists[i]:
            results.append(j)
    return results

#3

Thank you so much I understand how to make one list.


#4

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