Suppose you have a dictionary and a function that performs some arbitrary task on said dictionary, such as below:
dictionary = {
"a": 1,
"b": 2,
"c": 3,
}
def get_values(d: dict) -> list:
return [d[key] for key in d]
For each iteration of this for loop, is the function "get_values(dictionary)" called on each iteration, or just at the beginning?
for i in get_values(dictionary):
pass
Please give a brief explanation