Possible Error in Lloyd name key


#1



Hello. I am trying to complete Lesson number 1 on Student Becomes the Teacher. I keep getting an error message telling me that the name key does not have the value Lloyd in it. Is this an error or have I missed something?

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


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


#2

They should be in quotation marks, but not brackets.
Like "name": "Lloyd",
Same with

and


#3

Okay, fixed the problem. Thank you for the quick response.


#4

No problemo, glad I could help. :slight_smile:


#5

Hey there, in my post a bunch of us can't figure out the problem. My code worked for someone else, can you help? here is my code, try it out for yourself :slight_smile:

lloyd = {
    "name": "Lloyd",
    "homework": [90.0, 97.0, 75.0, 92.0],
    "quizzes": [88.0, 40.0, 94.0],
    "tests": [75.0, 90.0]
}
alice = {
    "name": "Alice",
    "homework": [100.0, 92.0, 98.0, 100.0],
    "quizzes": [82.0, 83.0, 91.0],
    "tests": [89.0, 97.0]
}
tyler = {
    "name": "Tyler",
    "homework": [0.0, 87.0, 75.0, 22.0],
    "quizzes": [0.0, 75.0, 78.0],
    "tests": [100.0, 100.0]
}
students = [lloyd, alice, tyler]

#6

Here is a link to my code and what people replyed

https://discuss.codecademy.com/t/student-becomes-the-teacher/70841/23

copy this and paste, please help meeeee


#7

I also believe there is a bug there, I added this code:
students = ['lloyd', 'alice', 'tyler']
to create the list named students, but it won't let me pass and complains about lloyd not being part of students.
Help please.


#8

the names should not be in quotes, they should just be the variables , [lloyd, alice, tyler]


#9

Thank you kyleaw, great and instantaneous help!


#10

And really this is not just to you but to all that might also have this same problem since I have seen it a lot recently is to really look and follow the examples that they give you in the lessons. For example, in Put It Together, they give you a list example where you have 3 dictionaries in it.

my_list = [1, 2, 3]

Now, obviously, this is rather basic but the format and more importantly for this the puncation and grammar marks is the same. Note that the example doesn't use quotes! Paying attention to the smaller details of the lessons can save you a lot of time and headache! :smiley:


#11

Thanks kyleaw for the help :slight_smile:


#12

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