Student becomes the Teacher: Lesson number one


#1

Oops, try again.
Did you create a dictionary named lloyd? Your code threw a "global name 'lloyd' is not defined" error.

This is the code I am using:
lloyd = {
"name":"Lloyd",
"homework",
"quizzes",
"tests"
}

alice = {
"name":"Alice",
"homeowork",
"quizzes",
"tests"
}

tyler = {
"name"="Tyler",
"homework",
"quizzes",
"tests"
}

Any ideas on what is wrong?

Replace this line with your code.


#2

The problem is here you mispelled homework.

alice = {
"name":"Alice",
"homeowork", 
"quizzes",
"tests"
}

#3

That worked. Thanks for the help


#4

lloyd = {
"name": "Lloyd",
"homework",
"quizzes",
"tests"
}
print lloyd["name"]
alice = {
"name": "Alice",
"homework",
"quizzes",
"tests"
}

tyler = {
"name": "Tyler",
"homework",
"quizzes",
"tests"
}

gives the message:
Oops, try again. Did you create a dictionary named lloyd? Your code threw a "global name 'lloyd' is not defined" error.

Any clue what I might be doing wrong here?


#5

Remove this line. :slight_smile:


#6

@arrayrockstar99240 ,

lloyd is not defined because you did not create the dictionary properly. You have ...

"homework",

In all three dictionaries, the keys, "homework", "quizzes", and "tests" all need to given empty lists as values, for example ...

"homework": [],

#7

Got it! Works now. Thank you so much!


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.