9.1.6 Checkerboard V1 Codehs 🆕 Best Pick

for i in range(8): row = [] for j in range(8): if (i + j) % 2 == 0: row.append("R") # R for red else: row.append("B") # B for black board.append(row)

Some versions of the CodeHS exercise use red instead of gray. If your prompt says "red and black", simply change the color in the conditional: 9.1.6 checkerboard v1 codehs

Example:

// 4. Add the rectangle to the Grid to visualize it grid.add(rect, row, col); for i in range(8): row = [] for