jenny Fra
jenny Fra

Reputation: 1

Turtle not working in IDLE

I'm running IDLE 3.4.3 in Win7 - Python 3.4.3.

I enter this code and save as testing.py:

from turtle import Turtle, Screen
    turtle = Turtle()
  screen = Screen()
  turtle.forward(100)

===========================

I get this error:

Traceback (most recent call last): File "C:/Users/xxxx/Desktop/testing.py", line 1, in from turtle import Turtle, Screen File "C:/Users/xxxx/Desktop\turtle.py", line 6, in forward(100) NameError: name 'forward' is not defined

>>>

I've tried all I can find on this site but still no joy. Help please.

Upvotes: 0

Views: 3876

Answers (1)

cdlane
cdlane

Reputation: 41925

File "C:/Users/xxxx/Desktop\turtle.py"

Don't name your source file turtle.py as that's the name of the turtle module and you end up confusing the import statement. Name it something else and try again.

Upvotes: 3

Related Questions