In Python 3.7.2 I have this output from a for loop:
{'London': {'House': 1800.00}}
{'London': {'Farm': 2500.0}}
{'Rome': {'House': 1500.00}}
{'Rome': {'Farm': 3000.00}}
I want to get this at last loop:
{ 'London':
{ 'House': 1800.00,
'Farm': 2500.00
},
'Rome':
{ 'House': 1500.00,
'Farm': 3000.00
},
}
I've tried many solutions as .update() and more, but I don't get the right way.
For example this solution override the first couple key value (as for .update() method):
dict(list(self.PRICE_LIST.items()) + list(price_location.items()))
{
"London": {
"Farm": 2500.00
},
"Rome": {
"Farm": 3000.00
},
}