title: Trying to draw a checkerboard using Turtle in Python - how do I fill in every other square?
body: <p>I'm trying to draw a checkerboard.</p>
  <p>I drew the board, but now I have to define a function (a loop) that fills in every other square with black. I've been trying to write a loop to do this for a while, can someone help?</p>
  <p>Here's my code:</p>
  <pre><code>import turtle
  
  
  def drawGrid():
  turtle.penup()
  turtle.goto(-300, 250)
  turtle.pendown()
  turtle.forward(300)
  turtle.right(90)
  turtle.forward(300)
  turtle.right(90)
  turtle.forward(300)
  turtle.right(90)
  turtle.forward(300)
  
  def drawColumns():
  for i in range(4):
      turtle.right(90)
      turtle.forward(37.5)
      turtle.right(90)
      turtle.forward(300)
      turtle.left(90)
      turtle.forward(37.5)
      turtle.left(90)
      turtle.forward(300)
  
  def drawRows():
  turtle.left(180)
  rows = 0 
  while rows &lt;= 3:
      rows += 1
      turtle.forward(37.5)
      turtle.right(90)
      turtle.forward(300)
      turtle.left(90)
      turtle.forward(37.5)
      turtle.left(90)
      turtle.forward(300)
      turtle.right(90)
  
  def main():
  drawGrid()
  drawColumns()
  drawRows()
  if __name__ == &quot;__main__&quot;:
  main()
  </code></pre>