import turtle
turtle.speed(0.2)
#边框
for i in range(4):
turtle.fd(200)
turtle.left(90)
#横向画线
x = 0
a = 25
for y in range(25, 200, a):
turtle.penup()
turtle.goto(x,y)
turtle.pendown()
turtle.fd(200)
#纵向画线
y = 200
turtle.right(90)
for x in range(25, 200, a):
turtle.penup()
turtle.goto(x,y)
turtle.pendown()
turtle.fd(200)
#填充偶数格
for x in range(0, 200, 2*a):
for y in range(25, 200, 2*a):
turtle.penup()
turtle.goto(x,y)
turtle.pendown()
turtle.begin_fill()
for z in range(4):
turtle.fd(25)
turtle.left(90)
turtle.end_fill()
#填充奇数格
for x in range(25, 201, 2*a):
for y in range(50, 201, 2*a):
turtle.penup()
turtle.goto(x,y)
turtle.pendown()
turtle.begin_fill()
for z in range(4):
turtle.fd(25)
turtle.left(90)
turtle.end_fill()
turtle.hideturtle()