everyone. I have the structure like this:
data = [
["apple", "1 apple", "2 apple"],
["lemon", "1 lemon", "2 lemon", "3 lemon"],
["lemon", "1 orange"]
]
And want the output like this:
{
"apple": {
"1 apple": {
"2 apple": 0
}
},
"lemon": {
"1 lemon": {
"2 lemon": {
"3 lemon": 0
}
},
"1 orange": 0
},
}
I have a lot of of lists (chains) in the data
, so I need your help!)
How to do it in python?