蟒蛇乌龟不工作

时间:2017-05-28 02:08:27

标签: python python-3.x

import turtle # Allows us to use turtles
wn = turtle.Screen() # Creates a playground for turtles
alex = turtle.Turtle() # Create a turtle, assign to alex
alex.forward(50) # Tell alex to move forward by 50 units
alex.left(90) # Tell alex to turn by 90 degrees
alex.forward(30) # Complete the second side of a rectangle
wn.mainloop() # Wait for user to close window



Traceback (most recent call last):
  File "C:/Users/Zixiang Li/Documents/Zixiang6666666.py", line 1, in <module>
import turtle # Allows us to use turtles
  File "C:/Users/Zixiang Li/Documents\turtle.py", line 10, in <module>
    wn = turtle.Screen() # Creates a playground for turtles
AttributeError: module 'turtle' has no attribute 'Screen'

我在我的电脑和Mac上试过,都没有工作。有人可以帮助我。谢谢!!

0 个答案:

没有答案