import turtle
def draw_square(x, y):
turtle.penup()
turtle.goto(x, y)
turtle.pendown()
for i in range(4):
turtle.forward(100)
turtle.right(50)
turtle.setup(600, 400)
turtle.title("Рисуем мышкой")
turtle.shape("turtle")
turtle.pensize(3)
turtle.onscreenclick(draw_square)
turtle.mainloop()
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
import turtle
def draw_square(x, y):
turtle.penup()
turtle.goto(x, y)
turtle.pendown()
for i in range(4):
turtle.forward(100)
turtle.right(50)
turtle.setup(600, 400)
turtle.title("Рисуем мышкой")
turtle.shape("turtle")
turtle.pensize(3)
turtle.onscreenclick(draw_square)
turtle.mainloop()