Python


#1

I am am having a really hard time with part 4 in the student becomes the teacher section, where it says 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

Which I did but I am still getting errors and I don't get what I am doing wrong.


#2

Post your full code!


#3

this is the full code.


#4

I mean copy paste your code so I can test it and find where you making mistake! :slight_smile:


#5


#6

The exercise implies a loop that iterates over each student dictionary.

for student in students:
    print student['name']
    print student['homework']
    print student['quizzes']
    print student['tests']

We can even elaborate on this to make it more dynamic:

for student in students:
    for key in student:
        print key, student[key]

However, there is no guarantee of which order the keys will print,


#7

It still doesn't work


#8

Please post your raw code (not a screenshot). Thanks. It would also help to have a link to the exact exercise.


#10

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