11. Student Becomes the Teacher ..need help here


#1



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

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

How do i resolve this error .please help me


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


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

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


#2

"Lloyd" is a string. You've defined the names as lists. See the difference?


#3

I received the same error, I didn't use [ ] around "lloyd". I did "name": "lloyd", it didn't work; I did "name": lloyd, it didnt work either. Same error message in both cases.


#4

I figured it out: need to capitalize the first letter in "Lloyd", so "name": "Lloyd".


#5

Seems like I also miss this part...strings can not be in []??


#6

yes , the editor is not accepting random inputs, even variable values


#7

Sure, you can have a list of strings. But that's not what is asked for.


#8

Can somebody share the complete code, I'm getting the same error with the following:

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"]

#9

I'm getting same error too, wtf is going on does somebody know?


#10

It wants the dictionaries in the list of students, not new strings.
students = [lloyd, alice, tyler]


#11

There are three ways to create the dictionary

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

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

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

#12

thanks helped me a lot