1. Lesson Number One


#1


  1. lesson number one

oops, try again. the name key does not have the value "Lloyd" in your lloyd dictionary


Replace this line with your code. 

my code:

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

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


#2

You need the first l in each case to be a capital letter.


#3

I tried that and still receive the following error:

Oops, try again. The name key does not have the value "Lloyd" in your lloyd dictionary.


#4

Could you post the updated code, please?


#5

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

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

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

thank you for helping


#6

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

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

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

this worked... but why should I upper case the name key in the dictionary but not the name of the dictionary itself?


#7

No idea, I guess it's just the way that it checks the code. Well done on figuring it out yourself :slight_smile:


#8

thank you! I thought the same thing- i guess that's just specifically what code academy wanted and not necessarily a syntax problem


#9

Yeah, it's definitely a problem in the test. Here is part of the test:

try:
    lloyd
except NameError as n_e:
    return "Did you create a dictionary named lloyd? Your code threw a \"%s\" error." % str(n_e)
except Exception as e:
	return "Something looks a bit off with the lloyd dictionary--your code threw a \"%s\" error." % str(e)
  
try:
    alice
except NameError as n_e:
    return "Did you create a dictionary named alice? Your code threw a \"%s\" error." % str(n_e)
except Exception as e:
    return "Something looks a bit off with the alice dictionary--your code threw a \"%s\" error." % str(e)
  
try:
    tyler
except NameError as n_e:
    return "Did you create a dictionary named tyler? Your code threw a \"%s\" error." % str(n_e)
except Exception as e:
    return "Something looks a bit off with the tyler dictionary--your code threw a \"%s\" error." % str(e)

As you can see, it trys each of the objects with lowercase spellings, so it's a requirement for them to be like that to pass - no syntax errors.


#10

Hi,

I was getting the same issue as snovosel but for a different reason. Here is my original code:
lloyd = {
'name': ["Lloyd"],
'homework': [],
'quizzes': [],
'tests': [],
}

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

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

I did just get it to work by taking the brackets off of each name key, but I'm curious why I had to. Are the brackets only used to signify a list that is empty at the point of creating it, so if it is populated (as in the case of the name key for each dictionary) then the brackets get dropped? Maybe I'm mis-remembering the list section further back in the course, but I thought you put brackets on lists whether or not they are populated.


#11

The reason it worked without [] is because with them, it's an array. The checker checks for an exact copy of the code. I can see the test itself, and it shows the code and cross-references it to make sure it's perfect.


#12

Oh totally, I see what you mean. So outside the confines of CodeAcademy's checker, would a single item array be acceptable? Or would Python still bark at me for putting brackets around a single item?


#13

The code has to be 100% perfect, indents included.


#14

need help with my code. please someone have a look.

STUDENT BECOMES TEACHER

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


#15

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


#16

Change "lloyd" "alice" and "tyler" to lloyd alice and tyler respectively.


#18

Anyone knows why this cannot work?

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


#19

got the answer
wrong spell...
thanks all the same


#20

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

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

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

Why it doesnt work?

Oops, try again.
The name key does not have the value "Lloyd" in your lloyd dictionary.


#21

Try removing the [] around "Lloyd"