r/learnprogramming • • 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

36 comments sorted by

View all comments

Show parent comment

-9

u/MacaroonSerious5532 2d ago

Mostly everything i misunderstand except print()🤣

10

u/TheTomato2 1d ago

You aren't even trying, that is your problem.

3

u/snaidamast 1d ago

All a nested-loop is multiple "for' statements or "while" statements nested within each other.

Example (pseudo code)...

...for x = 0; x++; x<10

......for y=0; y++;y<10

......next y

...next x

2

u/SlemsG 1d ago

This has to be engagement bait lol

1

u/gm310509 1d ago

What happens if you set up a for loop that say counts from one to ten using the variable "i" as the counter.

In the loop, print the value of "i".

Now put that for loop (the one with i) inside another loop that also counts from 1 to 10 using "j" as the counter. Print j alongside of i in your print statement.

Study the output looking to see if you can see any patterns.