#1.7 draw_five_pointed_star
#coding = utf-8
from turtle import *
import time
pencolor("red")
#定义画笔颜色
fillcolor("red")
#定义图形填充颜色
begin_fill()
#开始绘制图形
while True:
forward(200)
#向前回执直线
right(144)
#旋转画笔方向
if abs(pos()) < 1:
break
#pos()为画笔坐标,如果画笔回到坐标原点,结束循环
end_fill()
penup()
pencolor("blue")
forward(-50)
pendown()
fillcolor("blue")
begin_fill()
for i in range(5):
#总计有五根线,循环五次就可以了
forward(-200)
right(-144)
end_fill()
time.sleep(5)
#1.7 draw_five_pointed_star
猜你喜欢
转载自blog.csdn.net/AntInSnow/article/details/104253336
今日推荐
周排行