ch02-pag57

WITH PROGRAMMING IN Python, you can create a huge range of things, from games to scientific data analysis programs, and from 3D modelling tools to robot controllers. In Adventure 1, you learned how to use some basic Python code to make a spaceship command console. Now you’re going to try something a bit more visual.

Creating images with Python is a fun and powerful way to learn how to program. What’s great about it is that you can create complex images with programs that use only a few lines of Python code.

In this adventure, you’ll learn how to use numbers and Turtle Graphics to make drawings with Python. Figure 2-1 shows a drawing made with Turtle Graphics.

image

FIGURE 2-1 An example of a drawing made with Turtle Graphics.

Getting Started with Turtle

In this adventure, you’ll use the turtle module in Python. A module is a set of pre-written and reusable commands that extend what you can do with Python. Recall that you used the time module in Adventure 1 to make ...

Get Adventures in Python now with O’Reilly online learning.

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