五角星
import turtle as t
iimport turtle as t
t.fillcolor("red")#颜色填充函数
t. begin_fill()
while True:
t.forward(200)
t.right(144)
if abs(t.pos())<1:#看画笔是否回到原点,回到原点为真
break
t.end_fill()
t.pencolor("black")
for i in range(6):
t.right60)
t.fd(150)
t.done()
import turtle as t
iimport turtle as t
t.fillcolor("red")#颜色填充函数
t. begin_fill()
while True:
t.forward(200)
t.right(144)
if abs(t.pos())<1:#看画笔是否回到原点,回到原点为真
break
t.end_fill()
t.pencolor("black")
for i in range(6):
t.right60)
t.fd(150)
t.done()