Код: Выделить всё
import turtle as tu
turtle = tu.Turtle()
turtle.color("cyan1")
turtle.shape("turtle")
square_len = tu.textinput("Square Lenght", "Lenght")
def draw_square():
turtle.forward(square_len)
turtle.right(square_len)
turtle.right(square_len)
turtle.right(square_len)
draw_square()
screen = tu.Screen()
screen.exitonclick()
Код: Выделить всё
Traceback (most recent call last):
File "c:\Users\Hp\Desktop\Codes\temp.py", line 6, in
square_len = turtle.textinput("Square Lenght", "Lenght")
^^^^^^^^^^^^^^^^
AttributeError: 'Turtle' object has no attribute 'textinput'
square_len
, а затем нарисовать с их помощью квадрат
Подробнее здесь: https://stackoverflow.com/questions/785 ... -in-python