Reputation: 35
This is extremely frustrating. I am trying to run a very simple program and I can't even get it to work. I tried searching the forums and googling this specific error but I cannot find anything.
Here's what I wrote:
import turtle as t; t.forward(100)
Here s the error:
Traceback (most recent call last):
File "C:/Users/PC/AppData/Local/Programs/Python/Python35-32/dae.py", line 1, in <module>
import turtle as t; t.forward(100)
File "C:/Users/PC/AppData/Local/Programs/Python/Python35-32\turtle.py", line 2, in <module>
turtle.forward(100)
AttributeError: module 'turtle' has no attribute 'forward'
Please help
Upvotes: 0
Views: 1262
Reputation: 33651
Your file has name turtle.py
and that is why it is being imported in import turtle as t; t.forward(100)
instead of original turtle
module.
You have to rename your file in order to fix the issue.
Upvotes: 1