Lesson no.1


#1



    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"]

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


#2

You should be putting all those students in a list of students like this.

students = [lloyd, alice, tyler]


#3

But the names are the strings, aren't they?
So when I am creating list with the strings I am using " " in brackets?


#4

The students: lloyd, alice & tyler are dictionaries and you need to put them all in a list. They aren't strings now.


#5

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

students = [lloyd, alice, tyler]

this will work for sure :slight_smile:


#6

Thank you! :panda_face:


#7

You are welcome :slight_smile:


#8

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