Student Becomes The Teacher


#1



unsure as to why i am recieving an error message here. the messages states:
"Oops, try again. Did you create a dictionary named lloyd? Your code threw a "global name 'lloyd' is not defined" error."


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

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

tyler = {
    "name": "Ayler"
    "homework": []
    "quizzez": []
    "tests": []
    }


#2

You're missing your commas at the end of each property in each student.

Like this:

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

#3

i realise that just there and have placed all the commas but im still recieving the same error message


#4

Kindly post your new codes.

Thank you!


#6

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

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

tyler = {
"name": "Ayler"
"homework": [],
"quizzez": [],
"tests": [],
}


#7

Code looks good! [I sometimes advise you remove the last comma in the last property though]

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

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

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

#8

i have since corrected my code, i was placing the commas after the list items but not the "lloyd" string which causes the error. thanks for your help!


#9

You're welcome.

Have fun coding! :slight_smile:


#10

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