Python Forum

Full Version: Begginer problem with turtle
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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