I have some known values/variables a,b,c,d.
I would like to use these variables to create a dictionary in a list. I did the following but it did not work:
nestedlist['Name'] = a
nestedlist['Address']['StreetNumber'] = b
nestedlist['Address']['Zipcode']=c
nestedlist['Email']=d
I am getting the following error:
Traceback (most recent call last):
nestedlist['Address']['StreetNumber'] = b
KeyError: 'Address'
What am I missing here?
Before you do:
Do, this to create dictionary with key
Address
After that you can add key, value: