Python Forum
Begginer problem with turtle - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Begginer problem with turtle (/thread-29262.html)



Begginer problem with turtle - Damien_X - Aug-25-2020

So I'm watching a Youtube video and they tell me to write this:

qazi_turtle = turtle.Turtle()
qazi_turtle.forward(100)
(I'm using Python + Turtle on Repl.it btw.)

and in the video, when he presses run, everything works fine. In my case though, it tells me "NameError: name 'turtle' is not defined on line 10" in the console. How can I fix this?


RE: Begginer problem with turtle - GOTO10 - Aug-25-2020

The turtle functionality is contained in a module, which means it has to be imported for Python to use it. You can take care of that by adding a line at the top of your code:

import turtle