How to create a checkerboard on Python turtle?
I need to create a generic checkerboard in that box, if anyone knows how to code this I would be absolutely grateful and grant you brainliest for sure!

Respuesta :

tonb

Answer:

here is my crude attempt:

import turtle

t = turtle.Turtle()

t.speed(0)

colors = ["black", "yellow"]

SQUARES = 8

SQUARESIZE = 20

def rectangle(color, s):

 t.begin_fill()

 t.pendown()

 t.color(color)

 for i in range(4):

   t.forward(s)

   t.right(90)

 t.end_fill()

 t.penup()

for row in range(SQUARES):

 for col in range(SQUARES):

   t.setpos(row*SQUARESIZE, col*SQUARESIZE)

   rectangle(colors[(row+col)%2], SQUARESIZE)

ACCESS MORE