For the Record


#1



https://www.codecademy.com/courses/python-beginner-en-qzsCL/0/4?curriculum_id=4f89dab3d788890003000096


Oops, try again. Did you print out each student's name? It looks like "Lloyd" wasn't printed

Everything is all right in console, but error message appears...Could you explain me, please??


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]

for student in students:
    print("Student's name is: " + student['name'])

for student in students:
    print("The student's homework is: " + 
    str(student['homework']))

for student in students:
    print("The student's quizzes is: " + 
    str(student['quizzes']))
    
for student in students:
    print("The student's test is: " + 
    str(student['tests']))


#2

This may not be your error, but there is a much simpler way of doing this and I think it would look neater and save you time. Basically, you just need one for statement then you can print each category individually underneath. Here is a basic outline:

for what in what:
    print whatever
    print whatever
    print whatever
    print whatever

#3

Thanks. I tried it with statments only without any suplements and passed with suссess. But it's a litle bit strange - why I can't use suplements..


#4

for what in what:
print whatever
print whatever
print whatever
print whatever

you know i thought about doing it like this.....it seemed so simple and none efficient that im sitting here like i could do this better


#5

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