May-18-2020, 07:52 PM
I'm afraid I am not understanding dictionaries. After reading various articles the only thing I learned is I don't know what I am doing. To start, I am trying to produce this json structure.
I cannot figure out the syntax for nesting the 2nd dictionary (date1). Can someone give me a brief tutorial? TIA.
Output:{"stoker":{"sensors":null,"blowers":null}}
Here is the code I can't get right:1 2 3 4 |
data = { 'stoker' :{}} data1[ 'sensors' ] = 'null' data1.update( 'blowers' , 'null' ) data[ 'stoker' ].update(data1) |