I want to automatically add keys to the Python dictionary if they do not already exist. For instance,
a = "a" b = "b" c = "c" dict = {} dict[a][b] = c # doesn't work because dict[a] doesn't exist
How to automatically create keys if they do not exist?
source share