1/9 Global name "lloyd" is not defined


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

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

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

I have used indentation and still it says that global name "lloyd" is not defined


#2

did I mention that "quizzes": [], has come up as invalid syntax (it is within my dictionary)


#3

nevermind I found out what I did wrong. This never happened.


#4

what did you do wrong i have the exact same issue and for some reason cant figure out where im going wrong


#5

tyler dictionary has : missing for "homework" and "quizzes"


#6

I had the same error and similar code. Stared at it really hard, and then realized it was the lack of spacing before the colons causing the error... I never knew Python was sooo finicky about indents and spacing. Much pickier than Javascript!


#7

Hi.
–°arefully check the colon and the commas.


#8

try this code it worked for me when I had the same problem if this does not work try putting the name keys in square brackets then if there is still an error remove the brackets that is how I solved the problem
lloyd = {"name": "Lloyd", "homework": [], "quizzes": [], "tests": []}
alice = {"name": "Alice", "homework": [], "quizzes": [], "tests": []}
tyler = {"name": "Tyler", "homework": [], "quizzes": [], "tests": []}


#9

Thanks, although I really did not understand what was the problem here because I did the exact same thing, well never mind. It works and that's all that matters