五角星

 

 

 ①

import turtle

turtle.pensize(1)
turtle.fillcolor("red")
turtle.begin_fill()
for i in range(5):
    turtle.fd(200)
    turtle.right(144)
turtle.end_fill()

from turtle import *
fillcolor("red")
begin_fill()
while True:
    forward(200)
    right(144)
    if abs(pos())<1:
        break
end_fill()

from turtle import *
color("yellow","red")
pensize(10)
begin_fill()#和end_fill成对出现,填充起点和终点
while True:
    forward(200)
    right(144)
    if abs(pos())<1:#获取位置的绝对值
        break
end_fill()

 

posted @ 2020-03-16 16:56  燎沉香  阅读(103)  评论(0)    收藏  举报