Touching python
"KeyError: None"
I got the error. Make a note of the cause and correction method. (Corrected to what you received in the comments.)
You have specified the keys foo ['bar']
and bar
, but it is probable that the keys do not exist.
Since there is a possibility of a typo, review the key if you know the key yourself or if the key is described in the program. If not, insert the following code in the appropriate position.
python
...
print(foo.keys())
...#An error occurs here
Correct the ['bar']
part appropriately.
Recommended Posts