Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Parse output from json python

I have a json below, and I want to parse out value from this dict.

I can do something like this to get one specific value

print(abc['everything']['A']['1']['tree']['value'])

But, what is best way to parse out all "value?" I want to output good, bad, good.

 abc = {'everything': {'A': {'1': {'tree': {'value': 'good'}}}, 
'B': {'5': {'tree1': {'value': 'bad'}}},
'C': {'30': {'tree2': {'value': 'good'}}}}}

Answer*

Draft saved
Draft discarded
Cancel
1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. Commented Jan 28, 2022 at 14:10

lang-py

AltStyle によって変換されたページ (->オリジナル) /