Five-pointed star drawn
description
Use turtle graphics library rendering a red five-pointed star, as shown below:
Note: Mac OS platform above the filling effect is slightly different
Entry
no
Export
As FIG.
import turtle
turtle.fillcolor("red")
turtle.begin_fill()
while True:
turtle.forward(220)
turtle.right(144)
if abs(turtle.pos()) < 1:
break
turtle.fd(84)
for i in range(5):
turtle.fd(52)
turtle.right(72)
turtle.end_fill()
turtle.done()