turtle库绘制五星红旗

from turtle import *
bgcolor('red')
setup(800,500)

a={(-126,162):65,(-58,55):65,(-58,-48):65,(-126,-162):65,(-300,50):120}
def start(tuples,size):
up()
color('yellow','yellow')
goto(tuples[0],tuples[1])
begin_fill()
for i in range(5):
fd(size)
rt(144)
end_fill()
up()
goto(0,0)

if __name__=="__main__":
for key,value in a.items():
start(key,value)
hideturtle()
turtle.done()

posted @ 2020-06-02 10:25  misherry  阅读(1226)  评论(0)    收藏  举报