It's not working!


#1

I have a problem with this code.

lloyd = {
    "name": "Lloyd",
    "homework": [90.0, 97.0, 75.0, 92.0],
    "quizzes": [88.0, 40.0, 94.0],
    "tests": [75.0, 90.0]
}
alice = {
    "name": "Alice",
    "homework": [100.0, 92.0, 98.0, 100.0],
    "quizzes": [82.0, 83.0, 91.0],
    "tests": [89.0, 97.0]
}
tyler = {
    "name": "Tyler",
    "homework": [0.0, 87.0, 75.0, 22.0],
    "quizzes": [0.0, 75.0, 78.0],
    "tests": [100.0, 100.0]
}
students = ["lloyd, alice, tyler"]

#2

Get rid of the quotation marks (" ")in your students list. You're not trying to write a string in a list, you're trying to put the dictionaries in a list.


#3

Not exactly. The dictionaries are in the global namespace, not in the list. The list contains only references to those objects.


#4

Oops, I'm sorry. Should I delete this, or edit it out?
When I meant putting it in a list, I really meant putting it in: [ ]. I'm just used to calling it that.


#5

No need to edit. This is good information to leave exposed.


#6

Ok, I undid my edit from what you quoted- if that's the post you said to leave alone and not edit.


#7

Thanks it helped a lot now my code is working.


#8

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