Skip to content
Advertisement

Get values from keys in JSON [closed]

I got the JSON below:

JavaScript

How can I loop through the json using python to get the values of competition_id? I have tried using a for loop but it’s only giving competition id of premier league. Below is the code I wrote

JavaScript

Advertisement

Answer

As @Barmar said, you need to run your inner loop inside of your outer loop:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement