I am a total beginner and I am trying to create a program for a course that will go through a dataset about some results. I face a difficulty getting to all the teams in the following JSON:
{
"name": "English Premier League 2014/15",
"rounds": [
{
"name": "Matchday 1",
"matches": [
{
"date": "2014-08-16",
"team1": {
"key": "manutd",
"name": "Manchester United",
"code": "MUN"
},
"team2": {
"key": "swansea",
"name": "Swansea",
"code": "SWA"
},
"score1": 1,
"score2": 2
},
{
"date": "2014-08-16",
"team1": {
"key": "leicester",
"name": "Leicester City",
"code": "LEI"
},
"team2": {
"key": "everton",
"name": "Everton",
"code": "EVE"
},
"score1": 2,
"score2": 2
}],
}],
}
I used these lines of code:
for matchday in js['rounds'] :
print(matchday['matches'][0]['team1']['name'])
this will print the name of the first team from the first game of every round, yet I would like to print the name of all the first teams of every round. Could someone give me a hint?