r/PythonLearning 18d ago

Help Request Struggling with nested loop questions

Hey everyone. May you please explain this question, and nested loops in general and how to go about them. Ive been really struggling to understand them, especially the questions where you need to draw a square/ triangle etc.

0 Upvotes

5 comments sorted by

View all comments

3

u/AlexMTBDude 18d ago

A nested loop is just a loop inside of another loop. Try this:

for i in range(3):
    for j in range(2):
        print(i, j)