Lesson number one


#1

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

Error Shows This:
Oops, try again. Did you create a dictionary named lloyd? Your code threw a "global name 'lloyd' is not defined" error.


Lesson Number One
Lesson Number One
#2

dictionary keys need to have a value associated with them, your homework, quizzes and tests key have no vaue associated with it, see in the instructions what values this keys should have


#3

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

This one worked.

But why can't the keep the value empty. Defining value like[] would actually mean an empty list which may not be what I am trying to do.


#4

because dictionaries consist of key value pairs, you can't have one without the other

you are following the lists, which says empty list?

Either way, you have to follow the rules of python, a key needs to have an associated value


#5

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