I want to store new data(Key, value) to the nested dictionary. But I don't have any clue how to fix it.
def add(a,b,c,d,container)
container = {} # as database
data ={}
data[a] = [{"first": b, "second": c, "third": d}]
for e in data:
if date[date] not in calendar:
container[date[a]] = {}
container[date[a]].update([{"first": b, "second": c, "third": d})
add(name, 1, 2, hi, container)
add(name1, 2, 1, hi, container)
I see the following output:
{name: [{"first": 1, "second": 2, "third":hi }]}
{name1: [{"first": 2, "second": 1, "third":hi }]}
I expect the output as:
{name: [{"first": 1, "second": 2, "third":hi }], name1: [{"first": 2, "second": 1, "third":hi }]}
Please help me out!