CS Tutor
Home
Saturdays
Sundays
Playground
Tutor
← Back to Nested Loops
How Nested Loops Work
Step through code to see how the outer and inner loops run together
How Nested Loops Work
3×3 Grid
Triangle Pattern
Teams & Players
1
for
row
in
range
(
3
):
2
for
col
in
range
(
3
):
3
print
(
f"({row},{col})"
,
end
=
" "
)
4
print
() # new line
Back
▶ Play
Step
Ready
What's Happening
Press Play or Step to begin
Output
No output yet
Legend
Outer loop running
Inner loop running