Lesson 3 of 51 · Basics
Your First Turtle Program
Time to write your very first Turtle program! We'll create a simple square.
Python
from turtle import *
forward(150)
right(90)
forward(150)
right(90)
forward(150)
right(90)
forward(150)
done()Output

1
The Basic Structure
Every Turtle program starts by importing the turtle module. Then you give commands. Finally, done() keeps the window open.
2
Your First Commands
forward(n) moves the turtle n pixels forward. right(angle) turns it clockwise. Try changing the numbers to see different results!