Ответ:
import turtle
def draw_square(color, size):
turtle.color(color)
turtle.begin_fill()
for i in range(4):
turtle.forward(size)
turtle.left(90)
turtle.end_fill()
turtle.speed('fastest')
turtle.penup()
turtle.goto(-200, 200)
colors = ['white', 'black']
size = 50
rows = 8
columns = 8
for row in range(rows):
for column in range(columns):
color = colors[(row + column) % 2]
draw_square(color, size)
turtle.backward(size * columns)
turtle.right(90)
turtle.exitonclick()
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
import turtle
def draw_square(color, size):
turtle.color(color)
turtle.begin_fill()
for i in range(4):
turtle.forward(size)
turtle.left(90)
turtle.end_fill()
turtle.forward(size)
turtle.speed('fastest')
turtle.penup()
turtle.goto(-200, 200)
colors = ['white', 'black']
size = 50
rows = 8
columns = 8
for row in range(rows):
for column in range(columns):
color = colors[(row + column) % 2]
draw_square(color, size)
turtle.backward(size * columns)
turtle.right(90)
turtle.forward(size)
turtle.left(90)
turtle.exitonclick()