Lesson one problem


#1

What's wrong with this code? it keeps saying, " The name key does not have the value "Lloyd" in your lloyd dictionary."

indent preformatted text by 4 spaces
lloyd = {
"name" : ["Lloyd"],
"homework" : [],
"quizzes" : [],
"tests" : [],
}

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

tyler = {
"name" : ["Tyler"],
"homework" : [],
"quizzes" : [],
"tests" : [],
}
indent preformatted text by 4 spaces`


#2

You shouldn't make their names lists. They should be strings.


#3

Hello, @saifalizafar!
The problem with your code is that instead of associating a value with the key "name", you're associating a list.
Remember that all lists have [ ] before the first element and after the last element of it? So, that's what you did there!

Instead of doing that, simply remove the [ ] on each dictionary so it will work.

Quote me if there's anything else I can help you with!

Best regards,
g4be


#4

hey, thanks for the help! it works now :slightly_smiling:


#5

No problem at all!

Quote me whenever you need help with something else!

Best regards,
g4be


#6

Hey I'm kind of getting stuck here. I don't know what's wrong with my code. Could you help?

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

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

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


#7

@cynthia025: You forgot the comma "," right after "Alice" and "Tyler".

Best regards,
G4be