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 好文要顶 关注我