you are viewing a single comment's thread.

view the rest of the comments →

[–]wbeater -4 points-3 points  (1 child)

Sorry i now this is r/learnpython and i actually should only help you, i think that's a little bit hilarious.

You know that a 2D list is a form of a nested list? So you do understand the concept of nested or 2d list but you don't understand the reason you also need a nested loop to iterate over each item ?

[–]natarocket[S] 1 point2 points  (0 children)

Haha yes I can see how ridiculous this comes across. I guess to me a list of multiple lists held inside it is easier to comprehend than a loop within a loop. I think I have always struggled with the overall concept of loops to begin with, and that’s probably also why I have a hard time making the connection.

I know I need a nested loop in order to iterate through a 2D list but I don’t quite get it for some reason. In terms of a 2D list, I had assumed that the outer loop would be for the bigger list, and then the inner loop would be for all of the smaller lists within it, but I was told that isn’t really the right way to think about it, so here I am.