import turtle
def draw_square(side_length):
for _ in range(4):
turtle.forward(side_length)
turtle.right(90)
side_length = int(input("Введіть довжину сторони квадратів: "))
turtle.penup()
turtle.goto(-100, 0)
turtle.pendown()
for _ in range(5):
draw_square(side_length)
turtle.forward(10 + side_length)
turtle.exitonclick()
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
import turtle
def draw_square(side_length):
for _ in range(4):
turtle.forward(side_length)
turtle.right(90)
side_length = int(input("Введіть довжину сторони квадратів: "))
turtle.penup()
turtle.goto(-100, 0)
turtle.pendown()
for _ in range(5):
draw_square(side_length)
turtle.penup()
turtle.forward(10 + side_length)
turtle.pendown()
turtle.exitonclick()