Nov-18-2019, 10:07 AM
when you do
When you iterate over dict you itetrate over dict.keys(). So when you amend the code, you simply print the keys of
self.keys
there is one attribute keys
. In the loop you continuously override previously assigned value of that attribute, so the last value is the last key (three).When you iterate over dict you itetrate over dict.keys(). So when you amend the code, you simply print the keys of
keys_values
dict.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs