i have the following issue i have two list need to form a dictionary
header=["a","b","c"]
list=[1,2,4,5,7,9,6,5,1,5,8,12]
This is how i want the result to look like
{
outer1:{
inner1:{
"a":1,
"b":2,
"c":4,
},
inner2:{
"a":5,
"b":7,
"c":9,
},
}
outer2:{
inner1:{
"a":6,
"b":5,
"c":1,
},
inner2:{
"a":5,
"b":8,
"c":12,
},
}
}
i will appreciate your help incase anything needs clarification kindly comment
below is how i tried to solve the issue
dictionary = {"outer" + str(h+1): {"inner" + str(i): {
header[j]: list[h*len(header)+j] for j in range(len(header))} for i in
range(3)} for h
in range(len(list) // len(header))}