turtle has a couple of preset shapes which you can make use of in your programs, the first of which is
.circle(). As you can see, it needs a
radius as a minimum, and it draws a circle for you. However, there are two other parameters that you can use, which can make things more interesting. The first is
extent, which is how far around in degrees the circle will be drawn. So here, setting it to
180 degrees, half the circle is drawn.
steps allows you to pick how many steps the turtle will take to draw the circle. This makes it easy to draw regular polygons by setting the
steps to the number of sides you want it to have. Here, setting it to
3 draws a triangle.
We’ll come to color later on in the course, but for the time being, let’s enter a
size. As you can see, a filled-in circle has appeared where the turtle currently is, and we can create another one by issuing the same command again.
Become a Member to join the conversation.