Put it together - lesson 3


#1

put it together - 3
Student becomes the teacher

Error
Oops, try again. It looks like Lloyd is not in the students list.

I need to create a list

lloyd = {
    "name": "Lloyd",
    "homework": [90.0, 97.0, 75.0, 92.0],
    "quizzes": [88.0, 40.0, 94.0], #no double zeros allowed
    "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"]

No list being created. Please help.


#2

you create a list, but you store strings in them, you store the dictionary's in the list:

example = {
  "test1":"test2",
  "test3":"test4"
}
exampleList = [example]

see? I store the dictionary example in exampleList, you should do the same for your students


#3

oh yeah... i got it now.
I was using double quotes and henceforth made it a string.
Thank you so much stetim94.


#4

yea, you made it a string, while you want to store the dictionary's in the list, because this gives you the ability to loop over the list (aka the dictionary's in the list), which is super useful.

Good you understand :slight_smile: