简单的turtle模块代码python 3.9.7问题

simple turtle module code python 3.9.7 problem

我正在测试 turtle 模块,但命令不起作用。我在 windows 10 并下载了 python 3.9.7 这是代码:

>>> import turtle
>>> t = turtle.pen()
>>> t.forward(50)
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    t.forward(50)
AttributeError: 'dict' object has no attribute 'forward'
>>> 

此代码打开第二个 window 并显示海龟,但它不会向前移动并显示错误。有谁知道我该如何解决这个问题?

正确的语法是:

import turtle
t = turtle.Turtle() # create a Turtle and assign it to the variable "t"
t.forward(50)