其他分享
首页 > 其他分享> > 绘制五星红旗

绘制五星红旗

作者:互联网

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

 

标签:__,turtle,yellow,五星红旗,tuples,65,key,绘制
来源: https://www.cnblogs.com/energetic/p/13060364.html