18/18 Lst of lists in a functioh


#1

Sorry if I am wrong, but


if we need to receive one list we have to use results += i
if we will use .append() it gives us two lists in one


#2

That is because you are not iterating over the internal lists. Your code does not follow the directions, exactly.


#3

Could you show me how it is have to be?


#4

Iterate over the outer list:

for inner in lists:

Now iterate over the inner list:

    for x in inner:

Now append to the result:

        result.append(x)

#5

I see
Thank you for response


#6

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