Michael J. answered 06/08/19
Mathematics and Computer Programming for Gifted Students
Dictionaries are collections. That is they have iter and next implemented. Next returns the next key in the dictionary. Instead of index/value pairs like a list, dictionaries use key/value pairs.
The use of the name "key" is simply a variable name well chosen to represent the keys of the dictionary. You could easily change the name of "key" to "k" or "x" to test this, but "key" is an excellent choice as it best represents that data held in the variable.
If you want to iterate over the key/value pair try this:
for key, value in d.items():
#here you have access to both variables key and value
I'm happy to help you understand this better. If you'd like, please contact me for a lesson.