I have four arrays :
array1 = ["apple","orange","lemon"]
array2 = ["cola","fanta","sprite"]
array3 = ["cookies","sweets","chocolate"]
array4 = ["burger","pizza","pasta"]
What I would like to achieve :
complex_dict = {
'apple':[
[array2],
[array3],
[array4]
],
"orange":[
[array2],
[array3],
[array4]
],
"lemon":[
[array2],
[array3],
[array4]
]}
I tried to use dictionary comprehension:
complex_dict = {a: [[b],[c],[d]] for a,b,c,d in zip(array1,array2,array3,array4)}
Output :
{'apple': [['cola'], ['cookies'], ['burger']], 'orange': [['fanta'], ['sweets'], ['pizza']], 'lemon': [['sprite'], ['chocolate'], ['pasta']]}
Which is different from the one that I would like to achieve. Dear community, kindly ask for your help