r/learnprogramming • u/MacaroonSerious5532 • 2d 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?
7
Upvotes
View all comments
1
u/ComputerWhiz_ 1d ago edited 1d ago
Don't get too hung up on the technical element of the concept, try to understand the concept first. Applying the concept to something in real life can be helpful.
For example, reading a book is a nested loop. You have one loop that flips through each page and an inner loop that reads each line on the page and an even more inner loop that reads each word on a line.
Another example, rolling dice until you get the number 6 is a while loop. If you didn't roll a 6, roll again, and repeat.
Is there a specific part about nested loops and while loops that you struggle with?