Python includes a turtle. It’s not a real turtle, because you’d have to feed it and look after it — which would be cute, but probably wouldn’t teach you much about computers.
The Python turtle is a drawing bot. You can steer it around the screen and make it draw shapes. With only a little programming magic, you can make awesome pictures that will make your friends believe you’re a computer genius.
On the Raspberry Pi, the turtle is built right into Python. To use it, add a single line to the start of your code, like this:
That’s all you need. You can now write commands for the turtle. When you run your code, the turtle appears in a special window. It draws a line as it moves. It’s that simple!
Figure 12-1 shows the turtle drawing a complicated shape using a few simple commands.
Turtle programming is really, really easy because there are only three kinds of commands:
Most turtle programs have a block of starting code to set up the turtle and maybe define useful numbers ...