On the command line,
python3 -m turtle
Launch
IDLE
and pull down
Help → Turtle Demo
Then pull down
Examples
The start button is to the right of where it says
“Press start button”.
"""
Draw a star with an odd number of points.
The first straight line goes to the right.
The last straight line returns to the starting point.
"""
import turtle
n = 5 #Number of points. Also try 7, 9, or 3.
turtle.pencolor("red") #red outline
turtle.fillcolor("yellow") #yellow inside
turtle.begin_fill()
for _ in range(n):
turtle.forward(200) #in pixels
turtle.left(180 * (n + 1) / n) #in degrees
turtle.end_fill()
turtle.done()