I use Python 3.9 and I have a problem, I have a list:
keyList = ['a', 'b', 'c', 'd']
and I have a dictionary too, and I want to edit (update) this dictionary in the following way:
myDict = {}
#some code to add the keyList to myDict, this is my question, because I don't know...
myDict = {'a' : {'b' : {'c' : {'d' : 1}}}}
#or when myDict isn't equal to {}
myDict = {'a' : {'c' : 1}}
#same code to add the keyList to myDict
myDict = {'a' : {'c' : 1, 'b' : {'c' : {'d' : 1}}}}
#same code to add the keyList to myDict, but when it is created, add the +1 to value:
myDict = {'a' : {'c' : 1, 'b' : {'c' : {'d' : 2}}}}