Поэтому я копирую и вставляю этот код из своего онлайн-курса в свой python 2.7.10 и запускаю его. В нем говорится, что ширина не определена. Я попытался найти вопросы по этому поводу, но не смог найти, а также начал изучать кодирование, поэтому я не знаю, как импортировать модуль черепахи, не выдав мне ошибки.
from turtle import * # loads the turtle library...
width(5) # make the turtle pen 5 pixels wide
shape('turtle') # use a turtle shape!
forward(100) # turtle goes forward 100 steps
right(90) # turtle turns right 90 degrees
up() # turtle lifts its pen up off of the paper
forward(100) # turtle goes forward 100 steps
down() # turtle puts its pen down on the paper
color("red") # turtle uses red pen
circle(100) # turtle draws circle of radius 100
color("blue") # turtle changes to blue pen
forward(50) # turtle moves forward 50 steps
Traceback (most recent call last):
File "<pyshell#7>", line 1, in <module>
from turtle import * # loads the turtle library...
File "turtle.py", line 2, in <module>
width(5) # make the turtle pen 5 pixels wide
NameError: name 'width' is not defined