上图
其实主要是想练练循环,毕竟正方形的国旗不多,哈哈哈
import turtle
turtle.penup()
turtle.goto(125,125)
turtle.pendown()
turtle.pencolor("red")
turtle.fillcolor("red")
turtle.begin_fill()
for i in range(4):
turtle.right(90)
turtle.fd(250)
turtle.end_fill()
turtle.goto(26,-26)
turtle.seth(-90)
turtle.pencolor("white")
turtle.fillcolor("white")
turtle.begin_fill()
for i in range(4):
turtle.fd(60)
turtle.right(90)
turtle.fd(52)
turtle.right(90)
turtle.fd(60)
turtle.left(90)
turtle.end_fill()
turtle.hideturtle()
turtle.done()