4. For the record / Student becomes the teacher


#1
students = [lloyd, alice, tyler]
for student in students:
    print "Student's name: %s" % student["name"]
    print "Student's homework: %s" % student["homework"]
    print "Student's quizzes: %s" % student["quizzes"]
    print "Student's tests: %s" % student["tests"]
    print

Get the error: "Oops, try again. Did you print out each student's name? It looks like "Lloyd" wasn't printed." even though Lloyd is being printed in the console. any idea why?


#2

im getting the same thing and have tried it a few different ways, no clue


#3

just remove the string printing in front of the variable then it passes, all its looking for is, print student[name]
and the other variables of course, nothing else


#4

Wow that worked -.- I tried to do it the hard way to test my knowledge and it impeded me. Thanks for the reply!


#5

hah my pleasure, ya I have found that for things even as simple as capitalizing the first letter of a name sometimes thats enough to make the checker fail.


#6

Another option. This passed for me.

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"]
print student["homework"]
print student["quizzes"]
print student["tests"]


#7

Right ! I did the same as Codecademynoob, which I find cleaner than "%s..."


#8

all i had for my code when it passed is

students = ['lloyd', 'alice', 'tyler']

then pressed submit