In the early days of computing, a researcher named Grey Walter created a couple of simple robots that he commanded by telling them to move forward, backward, and to turn left and right. This idea was first used to teach children to draw simple graphics in the LOGO language. This concept has been added to many languages over the years and was included in the early days of Python.

You can still think of the “turtle” as a little robot that drags a pen to draw lines as it moves. The turtle in Python can also adjust the width of the pen, draw with over 16 million different colors, and do many more things. This chapter will be a brief introduction to the turtle object. More can be found in the python documentation.

Objectives

Upon completion of this chapter’s exercises, you should be able to:

  • Describe the turtle’s coordinate system.
  • Draw polygons using basic turtle motion commands.
  • Produce diagrams using colors, line width, and fill.
  • Change the turtle’s position to an absolute position on the drawing surface.
  • Display text on the turtle’s drawing surface.

Download PDF of Chapter