Lesson 26 of 51 · Loops & Functions
The while Loop
A while loop repeats as long as a condition is true.
Python
from turtle import *
bgcolor("black")
color("lime")
pensize(2)
speed(0)
length = 10
while length < 200:
forward(length)
right(90)
length += 10
done()Output

1
Syntax
while condition: — repeats until the condition becomes False.