"For the record" (4/9) task bug


#1


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


My output is just as it should be. But I get an error message like this
"Oops, try again. Did you print out each student's name? It looks like "Lloyd" wasn't printed. "
However, name "Lloyd" actually was printed.


lloyd = {
    "name": "Lloyd",
    "homework": [],
    "quizzes": [],
    "tests": []
}
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]
}
lloyd["homework"]=[90.0, 97.0, 75.0, 92.0]
lloyd["quizzes"]=[88.0, 40.0, 94.0]
lloyd["tests"]=[75.0, 90.0]

students=[lloyd,alice,tyler]
for item in students:
    print "name: %s" %item["name"]
    print "homework: %s" %item["homework"]
    print "quizzes: %s" %item["quizzes"]
    print "tests: %s" %item["tests"]


#2

Those lines are unnecessary.

Do not try to pretty print. Just output the dictionaries.


#3

What do you mean "pretty print"?


#4

Verbose, formatted output.

It will be enough to iterate over students, and output each item in their dictionary.

for student in students:
    print student['name']
    # and so on

#5

thanks man. I'll keep your advice in my head


#6

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