Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Python Turtle Error In Visual Studio Code

So i made a python turtle thing a while ago and it worked just fine. However, when i try to run it now it doesnt work. Here is the code:

import turtle
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.exitonclick()

It gives a error saying:

Exception has occurred: AttributeError
module ‘turtle’ has no attribute ‘forward’
File "C:\Users\melek büyük\Desktop\Programlama\Python\ptrh.py", line 2, in
turtle.forward(100)"

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

It didn’t do this before. Can someone please help me?

>Solution :

Seems like your file might be called turtle or you have another file called turtle. This would cause the import to not actual import the turtle library, so you should rename the file.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading