What is wrong with my code?


#1



Student Becomes the Teacher

All fields are printed but I receive this error message: "Oops, try again. Did you print out each student's name? It looks like "Lloyd" wasn't printed."

I expect to success this exercise


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 name:%s" % (student["name"])
    print "student homework:%.1f, %.1f, %.1f, %.1f" % (student["homework"][0], student["homework"][1], student["homework"][2], student["homework"][3])
    print "student quizzes:%.1f, %.1f, %.1f" % (student["quizzes"][0], student["quizzes"][1], student["quizzes"][2] )
    print "student tests:%.1f, %.1f" % (student["tests"][0], student["tests"][1])


#2

Is all that print code even asked for in the exercise?


#4

Those are the Instructions:
for each student in your students list, print out that student's data, as follows:

print the student's name
print the student's homework
print the student's quizzes
print the student's tests


#5

Got it, found a simplest way to print all the information and it worked, thanks!


#6

https://www.codecademy.com/en/courses/python-beginner-en-qzsCL/0/4

Now I see. Couldn't remember this lesson. Glad you found a simple way to do the print out. The exercise didn't expect any formatting, just the output.


#8