import turtle
window = turtle.Screen()
window.title("Малюнок з квадратів")
window.bgcolor("white")
pen = turtle.Turtle()
pen.speed(0)
start_size = 20
line_width = 1
def draw_square(size, width):
pen.width(width)
for _ in range(4):
pen.forward(size)
pen.right(90)
for i in range(5):
square_size = start_size + i * 20
line_width = i + 1
draw_square(square_size, line_width)
pen.penup()
pen.forward(50)
pen.pendown()
# Закриваємо вікно при натисканні на нього
turtle.done()
import turtle
window = turtle.Screen()
window.title("Малюнок з квадратів")
window.bgcolor("white")
pen = turtle.Turtle()
pen.speed(0)
start_size = 20
line_width = 1
def draw_square(size, width):
pen.width(width)
for _ in range(4):
pen.forward(size)
pen.right(90)
for i in range(5):
square_size = start_size + i * 20
line_width = i + 1
draw_square(square_size, line_width)
pen.penup()
pen.forward(50)
pen.pendown()
# Закриваємо вікно при натисканні на нього
turtle.done()