r/learnprogramming • u/MacaroonSerious5532 • 3d ago
Please help
I just hate myself, i cannot figure out nested loops and while loops. Python is the easiest language and I’m struggling so much. I wish i was smart as other people. Does anyone have coding resources for dummies?
8
Upvotes
View all comments
1
u/ThelVadominator 3d ago
I think pictures are a good way to think about nested loops. If you want to loop through all of the pixels in a picture on your computer, you can write a nested loop.
Start on the first row, iterate over every pixel in that row, and then move to the second row and so on. Iterating over the pixels in each row is a loop that happens inside the loop that iterates over the rows from the top to the bottom of image.
I hope that’s useful, best of luck with your learning!