绘制五星红旗

 1 from turtle import *
 2 bgcolor('red')
 3 setup(800,500)
 4 
 5 a={(-126,162):65,(-58,55):65,(-58,-48):65,(-126,-162):65,(-300,50):120}
 6 def start(tuples,size):
 7     up()
 8     color('yellow','yellow')
 9     goto(tuples[0],tuples[1])
10     begin_fill()
11     for i in range(5):
12         fd(size)
13         rt(144)
14     end_fill()
15     up()
16     goto(0,0)
17     
18 if __name__=="__main__":
19     for key,value in a.items():
20         start(key,value)
21     hideturtle()
22     turtle.done()

 

posted @ 2020-06-07 13:50  misherry  阅读(290)  评论(0编辑  收藏  举报