Bug: Looks Like Lloyd wasn't printed


#1

I got this code for the Student Becomes the Teacher:
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 "Name: %s" % student["name"]
print "Homework: %s" % student["homework"]
print "Quizzes: %s" % student["quizzes"]
print "Tests: %s" % student["tests"]

It keeps throwing the error: Looks like Lloyd wasn't printed. But if you check out the output, the data of Lloyd was actually printed.

I think this is a legit bug.


#2

I just ran into the same thing and I concur
.


#3

Try this.

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 s in students:
    print
    print s["name"]
    print s["homework"]
    print s["quizzes"]
    print s["tests"]

The code may be correct, but it is not the code it wants you to put.


#4

I think you are right rudy86.
I wrote the exact same code as jaydee_moralesgmail_ and I got an error message saying "Oops, try again. Did you print out each student's homework scores? It looks like Lloyd's homework scores weren't printed correctly." but it did print everything correctly and as I wanted it to print. However, it seems like the assignment doesn't want us to go all fancy. It simply wants us to print the key values. Annoying bug indeed.


#5

I'm not sure why, but when I did this section, I forgot to print anything and it let me pass. I'm not sure why this is happening.


#6

It is because the code is missing i[tests] in the last line