Lesson Number One


#1



https://codeacademy.com/courses/python-beginner-en-qzsCL/0/1?curriculum_id=4f89dab3d788890003000096


I'm trying to set the name key in the "lloyd" dictionary to be "Lloyd", however, I get an error message saying
"Oops, try again. The name key does not have the value "Lloyd" in your lloyd dictionary." I don't understand why this is happening, because it looks correct to me.


The name key is supposed to be set to "Lloyd"


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

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

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


#2

you need to remove the []'s


#3

oh, thanks. The others should be empty lists?


#4

indeed they should. :slight_smile:


#5

I am getting the following error:
Oops, try again. Did you create a dictionary named lloyd? Your code threw a "global name 'lloyd' is not defined" error.
Help needed.


#6

Hello,

I have tried removing the empty square brackets but something seems to be wrong since it is indicating us to provide the keys of the dictionary.
For example:

Code
llyod={"name": ["Lloyd"],}
alice={"name": ["Alice"],}
tyler={"name": ["Tyler"],"homework":[],"quizzes":[],"tests":[],}

Output
Oops, try again. Did you give alice the homework key?


#7

Look closely at the error, and your code...


#9

Thank you, made changes and its working now.


#11

Try removing the brackets from the name keys. :wink:


#12

im having the same issue, i removed the brackets but get the same error


#13

check for spelling mistakes... the error persisted for me due it :sweat_smile:


#14

Remove the brackets for the name key but leave the brackets for the rest of the keys. (If all else fails check over you syntax for any small mistake):relieved:


#15

I'm pretty sure this question is not functional, the only way to pass the level is to remove brackets around the 'Lloyd' assigned to the name key (why?) and have empty brackets for the empty lists.


#16

here's the correct answer

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


#17

thanks man! this took me so long to do...:grin:


#18

im having the same error and i don't understand why