← 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

1for row in range(3):
2for col in range(3):
3print(f"({row},{col})", end=" ")
4print() # new line
Ready

What's Happening

Press Play or Step to begin

Output

No output yet

Legend

Outer loop running
Inner loop running