# turtle graphics
from turtle import *
setup(800,800)
speed(10)
bgcolor("lightcyan")
shape("turtle")
shapesize(3)
color("red")
pensize(5)
n=5
for i in range(n):
forward(200)
left(360/n)
setheading(180)
penup()
forward(200)
color("blue")
例2 ぬりつぶし
# turtle graphics
from turtle import *
shape("turtle")
shapesize(4)
showturtle()
width(8)
color("blue") #color of the line
Screen().bgcolor("lightcyan") #background color
begin_fill()
left(90)
setheading(0)
for i in range(5): # 5回繰り返す
forward(200) # 200進む
left(360/5)
end_fill()
penup()
setheading(-90)
forward(200)
pendown()
color ("red")
begin_fill()
circle(100)
end_fill()
penup()
right(90)
forward(200)