-1
我想在python中创建一个非常简单的程序,并试图尝试这一点,但我按f5运行,然后程序说shape()是未定义的。这里是我的代码:程序不会在Python龟中运行
import turtle
shape("turtle")
i=0
while i<360:
circle(100)
right(1)
i+=1
这里是我的日志,当我按下F5:
Traceback (most recent call last):
File "C:\Users\coold\Documents\Coding\PythonStuff\turtle.py", line 1, in <module>
import turtle
File "C:\Users\coold\Documents\Coding\PythonStuff\turtle.py", line 3, in <module>
shape("turtle")
NameError: name 'shape' is not defined
>>>
是的。 'shape'确实没有定义*。你可能意思是'turtle.shape(“turtle”)' –
或者,你可能打算使用'from turtle import *',尽管这很麻烦。 – Junuxx