Interesting. I thought it would raise a NoneType error instead. As I understand it, adding the second index requires an object to work. So, the interpreter is raising the KeyError because the key doesn't exist and so cannot have a value.
To make this work, you'll need to set the values to dicts before setting the those values.
To make this work, you'll need to set the values to dicts before setting the those values.