Lesson 27 of 51 · Loops & Functions
Nested Loops
Loops inside loops create complex patterns.
Python
from turtle import *
bgcolor("black")
color("cyan")
pensize(1)
speed(0)
for i in range(36):
for j in range(4):
forward(80)
right(90)
right(10)
done()Output

1
How It Works
The inner loop runs completely for each iteration of the outer loop.