名称 'turtle' 未在 main.py 中的第 4 行定义

name 'turtle' is not defined on line 4 in main.py

抱歉提出愚蠢的问题,python 的新问题。我有以下代码,运行ning python 3.7:

from turtle import *
color('blue', 'red')
turtle.pu()
turtle.goto(0,0)
turtle.pd()
begin_fill()
forward(55)
left(90)
forward(110)

当我点击运行时,它说我在第三行和第四行有错误,但我无法弄清楚哪里出了问题。我试着到处搜索,但找不到任何可以帮助我弄清楚我做错了什么的东西。

您需要创建一个 Turtle 对象的实例才能使用它

from turtle import *

bob = Turtle()
color('blue', 'red')
bob.pu()
bob.goto(0,0)
bob.pd()
begin_fill()
forward(55)
left(90)
forward(110)