This problem is similar to another where I learned How to Create Nested Dictionary in Python with 3 lists
How can I achieve an output such from 3 lists that takes the following output form
a = ['A', 'B', 'C', 'D']
b = [1,2,3,4]
c = ['N1', 'N2', 'N3', N4]
output = [{'A': {'N1':1}}, {'B':{'N2':2}}, {'C':{'N3':3}}, {'D':{'N4':4}}]
The output is different than on the posted link. If I could describe this I would say it is a dictionary where 'N#' are the keywords for the values 1-4, and in turn those dictionaries have keyword 'A'-'D', which all seem to be dictionaries insided some top level keyword not shown under which they all are the elements of that master keyword.
I used this line of code which provided an output. These are different values than I'm using, but the point is this doesn't have as many curly brackets or the square brackets at the edges
d = {k: {x: y} for k, x, y in zip(a, b, c)}
# output: {'A':{'1' :'9'} , 'B':{'2':'8'}, 'C':{'3':'7'} , 'D':{'4':'6'}}
So I've explained what I think it means but I'm not sure how to proceed. I tried doing something like
d = {w:{k:{x:y}}for w,k,x,y in zip(sound, a, b, c)}
where 'sound' is a list of the same element value but that just prints out the 4th things on the list. Any help to clear this up would be much appreciated. Thanks.