Lloyd wasnt printed


#1



For the Record Exercise


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


Seems the expectation is to print the name of the dictionary instead of the value of the KEY :Name


students = [lloyd,alice,tyler]

for n in students:
        
        print "the %s\'s name %s" %(n["name"],n["name"])
        print "the %s\'s homework %s" %(n["name"],n["homework"])
        print "the %s\'s quizzes %s" %(n["name"],n["quizzes"])
        print "the %s\'s tests %s" %(n["name"],n["tests"])


#2

Seems the expectation is to print the name of the dictionary instead of the value of the KEY :Name

No, not really. The expectation is to print only the things that you were asked to print. The extra text, description is what causes failure of tests.

for n in students:
    print "%s" %(n["name"])
    print "%s" %(n["homework"])
    print "%s" %(n["quizzes"])
    print "%s" %(n["tests"])

#3

Thanks.

I Tried that later and it worked fine.


#4

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