Turtle circles: circle() and dot()
circle(radius) makes the turtle drive round a circle, and dot(size) puts a
round, filled spot where the turtle stands.
Draw a circle
import turtle
t = turtle.Turtle()
t.circle(80)
The turtle drives round to the left. The centre is radius steps to its left,
so this circle sits above the start, with its centre at (0, 80). The turtle
ends where it began.
Go the other way with a negative radius
A negative radius puts the centre on the turtle's right, so it drives round clockwise:
import turtle
t = turtle.Turtle()
t.circle(60)
t.circle(-60)
One circle above the start and one below it: a figure eight.
Draw part of a circle
A second number, the extent, draws only that many degrees of the circle.
180 is half a circle:
import turtle
t = turtle.Turtle()
t.circle(50, 180)
print(t.position())
print(t.heading())
The turtle stopped at the top, (0.00,100.00), now facing left (180.0).
Draw polygons with steps
steps draws the circle with that many straight sides:
import turtle
t = turtle.Turtle()
t.circle(60, steps=3)
t.circle(60, steps=6)
A triangle and a hexagon that fit the same circle.
Put down dots
dot(size, colour) draws a filled spot size pixels across. It draws even with
the pen up.
import turtle
t = turtle.Turtle()
t.penup()
t.dot(30, "red")
t.forward(50)
t.dot(20, "orange")
t.forward(40)
t.dot(10)
Without a colour, the dot uses the pen colour.
See also: Drawing shapes with turtle loops, Filling shapes.
Your turn
Add two lines: draw a quarter of a circle with radius 100, then put a dot of
size 15 where it ends.
import turtle
t = turtle.Turtle()
# add two lines: a quarter circle with radius 100, then a dot of size 15
print(t.position())
print(t.heading())
Expected output
(100.00,100.00)
90.0