For example, I am iterating through a dictionary mydict as follows:
mydict = {"Name" : "Vincent Vega", "Profession" : "Gangster", "Age" : "42"} for k in mydict: print k, mydict[k] Now, k is just a looping variable that I didn't even declare. How does the compiler know that by k, I mean the keys of the dictionary?