November 2022
Beginner
368 pages
6h 47m
English

Let’s return to the turtle module we began using in Chapter 4. In this chapter, we’ll learn that Python turtles can do a lot more than draw plain black lines. You can use them to draw more advanced geometric shapes, create different colors, and even fill your shapes with color.
We’ve previously used the turtle module to draw simple shapes. Let’s import the turtle module and create the Turtle object:
>>> import turtle >>> t = turtle.Turtle()
We used the following code in Chapter 4 to create a square:
>>> t.forward(50) >>> t.left(90) >>> t.forward(50) >>> t.left(90) >>> t.forward(50) >>> t.left(90) ...