Lesson number One : My code's key value doesn't match the one expected


#1


I have been stuck in this step for the last half hour and it's driving me mad.
I'm pretty sure that my code is correct, I tried the same in an another interpreter and it worked.

Yet on CodeCademy's console, I get this 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":[],
    }


I can't tell what's the problem for the life of me. I even copypasted the string Lloyd right from the error message.


#2

Hi, @netrunner10450.

You defined each dictionary's value associated with the "name" key as a string inside a list ...

"name":["Lloyd"],

The values associated with that key should simply be strings ...

"name": "Lloyd",

... for each of the students.


#3

But of course ! Brackets for multiple values as key for a single item, aka a list of values for a single key.

Thank you @appylpye :slight_smile:


#4

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