Problem scenario
You have some JSON files like this:
$cat first.json
{“bird”: {“name”: “singy”, “species”: “sparrow”, “amount”: “45”}}
$ cat second.json
{“bird”: {“name”: “flighty”, “species”: “seagull”, “amount”: “21”}}
Within the “bird” key there are other keys. How do you create a tuple with the species values?
Solution
Place first.json, second.json and the Python program below (called reader.py) in the same directory.
…