Python Forum
Begginer problem with turtle
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Begginer problem with turtle
#1
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?
Reply
#2
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Photo Problem installing turtle MasterJediKnight7 17 24,588 Mar-18-2024, 10:22 AM
Last Post: bmohamadyar313
  Nested while loop problem + turtle DreamingInsanity 3 2,945 Jul-06-2019, 02:01 PM
Last Post: DreamingInsanity
  wn = turtle.screen() AttributeError: module 'turtle' has no attribute 'screen' Shadower 1 6,171 Feb-06-2019, 01:25 AM
Last Post: woooee
  Help! Turtle not working, even when we click the turtle demo in IDLE nothing happens. BertyBee 3 5,618 Jan-04-2019, 02:44 AM
Last Post: SheeppOSU
  Someone please help a begginer leonr 3 3,316 Mar-13-2018, 02:35 PM
Last Post: leonr
  Begginer coding problem wiktor 2 3,215 Jan-26-2018, 06:24 PM
Last Post: wiktor
  Turtle Problem OmarSinno 2 10,361 Sep-26-2017, 07:55 AM
Last Post: OmarSinno

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020