A key error has occurred. The cause was trying to access the dictionary with a key that does not exist.
If you try to access with a key that does not exist, a key error will occur, so
if key in dictionary:
dictionary[key] = "hoge"
Or
if dictionary.haskey(key):
dictionary[key] = "hoge"
This way to prevent errors.
Recommended Posts