Whats the Error?
Cdogo (2)

Python is giving me an error that says turtle is not defined even though I imported it in the first line.
what should I do?

You are viewing a single comment. View All
DJWang (1202)

Hi John! You have forgotten to make a parameter for the turtle! Instead of

def makeDots(num):
	import turtle
	ret = {}
	t = Turtle()
	t.penup()

Try this:

import turtle

T = turtle.Turtle()
def makeDots(num,t):
	import turtle
	ret = {}
	t = Turtle()
	t.penup()

Then wherever you use the turtle outside the function just change it to capitalized or another name.