when you iterate over dict, you iterate over keys only, i.e.
for key in some_dict:
is equivalent to for key in some_dict.keys():
. You need to iterate over some_dict.items()
if you want to get both key and value, i.e. you get (key, value)
tuple which you unpack, in your case into a
and b
respectively
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