note that you can not have multiple identical keys in a dict. At each iteration of the first loop tenant_d is a dict with values for just one tenant. Then you print that dict and continue with next iteration if you look at the original json you will notice that tenants["items"] is actually a list of dicts. You need something like this to store the tenant_d if you want to keep all of them. Again that will replicate the original structure
after you finish the first loop tenant_d has the values for the last item in the list. that is what you iterate over and print in the second loop
after you finish the first loop tenant_d has the values for the last item in the list. that is what you iterate over and print in the second loop
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs