绘制旗帜
import turtle
turtle.setup(600,400,0,0) #设置窗口大小为600 *400
turtle.color('yellow') # 画笔设置成黄色
turtle.bgcolor('red') #
turtle.fillcolor('yellow')
def mygoto(x,y):
turtle.up()
turtle.goto(x,y)
turtle.down()
mygoto(-250,75)
turtle.begin_fill()
for i in range(5):
turtle.forward(100)
turtle.right(144)
turtle.end_fill()
mygoto(-100,150)
turtle.begin_fill()
for i in range(5):
turtle.forward(50)
turtle.right(144)
turtle.end_fill()
mygoto(-80,80)
turtle.begin_fill()
for i in range(5):
turtle.forward(50)
turtle.right(144)
turtle.end_fill()
mygoto(-70,20)
turtle.begin_fill()
for i in range(5):
turtle.forward(50)
turtle.right(144)
turtle.end_fill()
mygoto(-80,-40)
turtle.begin_fill()
for i in range(5):
turtle.forward(50)
turtle.right(144)
turtle.end_fill()
turtle.done()