用python画五星红旗

from turtle import *

def mygoto(x,y):
    up()
    goto(x,y)
    down()

setup(600,400,0,0)
color('yellow')
bgcolor('red')
fillcolor('yellow')

mygoto(-250,75)
begin_fill()
for i in range(5):
    forward(100)
    right(144)
end_fill()

mygoto(-100,150)
begin_fill()
for i in range(5):
    forward(50)
    right(144)
end_fill()

mygoto(-50,100)
begin_fill()
for i in range(5):
    forward(50)
    right(144)
end_fill()

mygoto(-50,50)
begin_fill()
for i in range(5):
    forward(50)
    right(144)
end_fill()

mygoto(-100,0)
begin_fill()
for i in range(5):
    forward(50)
    right(144)
end_fill()

done()



 




 

 

posted @ 2018-03-19 09:27  095罗冠达  阅读(901)  评论(0编辑  收藏  举报