1 What is a turtle?
In Python, a turtle isn’t a real animal — it’s a little arrow that starts in the middle of the screen. Wherever the turtle walks, it leaves a line behind it, like it’s holding a pen. If we tell the turtle where to go, we can draw pictures with code!
Everything you need is right here on this page — a box to type code, and a screen next to it where the turtle draws. No extra websites or logins needed.
2 How to use the code box
- On the left of the black box below: type your code.
- On the right: a white screen where the turtle will draw.
- Click the orange Run button to see what your code does.
- If you want to start again, click Reset.
3 Your very first line of code
Some code is already waiting for you below. Click Run and watch what happens.
Try it:
Change the number 100 to 50.
Click Run.
Now change it to 200.
Click Run again.
What changes?
4 Teaching the turtle to turn
A turtle that only goes forward isn’t very exciting. Let’s make it turn.
t.right(90) spins the turtle a quarter-turn to the right, like turning a corner. Then it walks forward again, drawing a new line.
A full turn all the way around is 360°. If a quarter turn is 90°, how many degrees would a half turn be?
5 Now you try: draw an L-shape
Using just t.forward() and t.right(), write code that makes the turtle draw the letter L.
Hint:
An L-shape is just two straight lines with one turn in the middle.
How many degrees is that turn?
Once it works:
Try drawing a Z shape.
Try drawing a staircase shape.
What you learned in this lesson
import turtlebrings in the turtle toolt.forward(steps)moves the turtle and draws a linet.right(degrees)turns the turtle- 90° makes a right-angle turn, like the corner of a square
