python turtle 名称错误:形状未定义

当我在 Mac OS 中使用 python 3.8.3 尝试此代码时:


from turtle import *

shape("turtle")

我收到此错误:


Traceback (most recent call last):

  File "C:\Users\jeeva\Desktop\Tanmay_new\python\pi\Draw_pi\draw_pi.pyw", line 2, in <module>

    shape("turtle")

NameError: name 'shape' is not defined

看起来 python 没有调整形状。


慕标琳琳
浏览 186回答 1
1回答

侃侃无极

查看是否有除模块之外的名为turtle.py的文件。重命名并重试
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python