My dictionary error


#1

I'm not sure what I'm doing wrong here. My dictionary appears to be in order but when I submit my code I get "The name key does not have the value 'Lloyd' in your lloyd dictionary".


#2

Hi remove your students name inside [ ] Inside your dictionary


#3

Remove the [] brackets from the names:

"name" : "Lloyd"
"name" : "Alice"
"name" : "Tyler"

#4

Neither are working for me :neutral_face:

Found a fix! remove the names from the [], and capitalize the first letter( i know yours was already like that, but mine wasn't lol) My mistake.


#5

i have the same question .
Why it worked after i removed [] ? shouldn't be like their example above?


#6

The example is just a help, you should do as the instructions tell you.

You don't use [] at the name, because every student has only one name. If you call the dictionary of alice, it should give you the name of Alice only, right? So you don't have more than one element for the name.
The [] will create you a list, which won't make any sense for just one element, because you won't append the name of that student or add anything else to it.

In the example, it says animal__sounds, of course a cat and a dog have more than one sound to make, so you need a list to set all sounds (more than 1) to the animal.