11. Student Becomes the Teacher: I don't know why this worked...Could someone please explain?


#1


#2

for d in students: The variable d references in turn, one of the named dictionaries in the students list.

In each dictionary, there are four properties, the key in for key in d: is again in turn, each of the property names.

So now we have a dynamic reference to a dictionary, and the key names which we can combine to ascertain the values associated with them.

    print d[key]