Chapter 4. Drawing with Turtles

A turtle in Python is sort of like a turtle in the real world. We know a turtle as a reptile that moves around very slowly and carries its house on its back. In the world of Python, a turtle is a small, black arrow that moves slowly around the screen. Actually, considering that a Python turtle leaves a trail as it moves around the screen, it’s actually less like a turtle and more like a snail or a slug.

The turtle is a nice way to learn some of the basics of computer graphics, so in this chapter, we’ll use a Python turtle to draw some simple shapes and lines.

Using Python’s turtle Module

A module in Python is a way of providing useful code to be used by another program (among other things, the module can contain functions ...

Get Python for Kids now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.