I'm new in Python and currently trying to read the following JSON:
"level1_key1":"1",
"level1_key2":{
"level2_key1":"2",
"level2_key2":{
"level3_key1":"Max depth"
}
}
then put it in a dictionary (done by now) and finally show it as nested and flatten (I'm using Python 3.6). I want to do it with recursion and avoid using third party libraries. I tried all the suggestions from StackOverflow but can't make the result look like the one from the task which is:
Nested dict: {u'level1_key2': {u'level2_key2': {u'level3_key1': u'Max depth'}, u'level2_key1': u'2'}, u'level1_key1': u'1'}
Flatten dict: {u'level2_key1': u'2', u'level3_key1': u'Max depth', u'level1_key1': u'1'}
I'd much appreciate any help. Thanks in advance!