I have a following dictionary:
d = {'key':{'key2':[]}}
Is there any way to append to d[‘key’]?
I want to get:
d = {'key':{'key2':[], 'key3':[]}}
d[‘key’] = [‘key3’] apparently does not produce the desired outcome..
I know I can do
d = {'key': [{'key2': []}]}
and then append to d[‘key’] in a loop, but I am trying to avoid that..
You’re looking for