I have two quick questions about the attached screenshot:
why does the answer in (see screenshot) look have
for key in my_dictionary.keys()
Specifically I’m looking at both of the “keys” in the line.
I thought we were talking about the values (b/c we were adding ten).
So I wrote something like:
for value in my_dictionary.values()
Why do we use key in both instances instead of value?
In the next line why do we use
my_dictionary[key] += 10
Because we were talking about a dictionary I mistakenly used {}
I actually made it:
my_dictionary{values} again because I though we were seeking the value instead of the key.
For more info the question itself asks: " The function should add 10 to every value in".
That’s part of why I used “value” over and over instead of “key”.