a={
"a": "1",
"b": "2",
"c": "3",
"properties": {
"test1": "1",
"test2": "2",
"test3": {
"a1": "70",
"a2": "71",
"a3": {
"b1": "80",
"b2": "81",
"properties": {
"b1": "20",
"b2": "21",
},
"d1": "30",
"d2": "31",
},
},
},
}
i want "a" to just have all the keys and value inside of "properties" key.
final_a = {
"test1": "1",
"test2": "2",
"test3": {
"a1": "70",
"a2": "71",
"a3": {
"b1": "20",
"b2": "21",
},
},
}
I have tried all the solution on Find all occurrences of a key in nested dictionaries and lists