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()


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM