4. New Record


#1



When I submit my code I get the error "Oops, try again. Did you print out each student's name? It looks like "Lloyd" wasn't printed."

This is what my output is.
Student: Lloyd
Homework grades: [90.0, 97.0, 75.0, 92.0]
Quiz grades: [88.0, 40.0, 94.0]
Test grades: [75.0, 90.0]
Student: Alice
Homework grades: [100.0, 92.0, 98.0, 100.0]
Quiz grades: [82.0, 83.0, 91.0]
Test grades: [89.0, 97.0]
Student: Tyler
Homework grades: [0.0, 87.0, 75.0, 22.0]
Quiz grades: [0.0, 75.0, 78.0]
Test grades: [100.0, 100.0]
None


Replace this line with your code. 
This is my code for 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[0:3]:
    print "Student: %s" % student["name"]
    print "Homework grades: %s" % student["homework"]
    print "Quiz grades: %s" % student["quizzes"]
    print "Test grades: %s" % student["tests"]


#2

Hi these lines

    print "Student: %s" % student["name"]
    print "Homework grades: %s" % student["homework"]
    print "Quiz grades: %s" % student["quizzes"]
    print "Test grades: %s" % student["tests"]

just remove the string(s) before

student[".."]

#3

Just figured this out!

Thanks for the reply!


#4

i am having the same problem ..
and i am unable to understand the solution provided by you .


#5

Hi, I've the same problem. Could anyone solve this?
I dont understand which is the mistake.
My code is this:
students = [lloyd, alice, tyler]
for student in students:
print "Student: %s" % student["name"]
print "Homework grades: %s" % student["homework"]
print "Quiz grades: %s" % student["quizzes"]
print "Test grades: %s" % student["tests"]


#7

So far, I have this code:

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" % student["name"]
print "Homework grades: %s" % student["homework"]
print "Quiz grades: %s" % student["quizzes"]
print "Test grades: %s" % student["tests"]

But, when I ran this code: I came up with this error:

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

But, the output looked like this:

Student: Lloyd
Homework grades: [90.0, 97.0, 75.0, 92.0]
Quiz grades: [88.0, 40.0, 94.0]
Test grades: [75.0, 90.0]
Student: Alice
Homework grades: [100.0, 92.0, 98.0, 100.0]
Quiz grades: [82.0, 83.0, 91.0]
Test grades: [89.0, 97.0]
Student: Tyler
Homework grades: [0.0, 87.0, 75.0, 22.0]
Quiz grades: [0.0, 75.0, 78.0]
Test grades: [100.0, 100.0]
None

It seemed that I just can't get rid of that error. What can I do?


#8

same problem here? maybe remove the strings before student[...]

yep but it looks awful, i mean it would make more sense as Student: Lloyd, but instead its only Lloyd.
anyway.


#9

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