title: Using Nested Loops to Iterate over Dictinaries
body: <p>This is my given list with dictionaries:</p>
  <pre><code>soccer_match = [
    { &quot;home_team&quot;: True,
      &quot;away_team&quot;: False,
      &quot;country&quot;: &quot;France&quot;,
      &quot;num_passes&quot;: 484,
      &quot;passes_completed&quot;: 423,
      &quot;fouls_committed&quot;: 16,
      &quot;colors&quot;: [&quot;blue&quot;, &quot;white&quot;, &quot;red&quot;],
      &quot;players&quot;: [
        {
          &quot;name&quot;: &quot;Hugo LLORIS&quot;,
          &quot;captain&quot;: True,
          &quot;shirt_number&quot;: 1,
          &quot;position&quot;: &quot;Goalie&quot;
        },
        {
          &quot;name&quot;: &quot;Benjamin PAVARD&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 2,
          &quot;position&quot;: &quot;Defender&quot;
        },
        {
          &quot;name&quot;: &quot;Raphael VARANE&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 4,
          &quot;position&quot;: &quot;Defender&quot;
        },
        {
          &quot;name&quot;: &quot;Samuel UMTITI&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 5,
          &quot;position&quot;: &quot;Defender&quot;
        },
        {
          &quot;name&quot;: &quot;Paul POGBA&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 6,
          &quot;position&quot;: &quot;Midfield&quot;
        },
        {
          &quot;name&quot;: &quot;Antoine GRIEZMANN&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 7,
          &quot;position&quot;: &quot;Forward&quot;
        },
        {
          &quot;name&quot;: &quot;Kylian MBAPPE&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 10,
          &quot;position&quot;: &quot;Forward&quot;
        },
        {
          &quot;name&quot;: &quot;Ousmane DEMBELE&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 11,
          &quot;position&quot;: &quot;Forward&quot;
        },
        {
          &quot;name&quot;: &quot;Corentin TOLISSO&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 12,
          &quot;position&quot;: &quot;Midfield&quot;
        },
        {
          &quot;name&quot;: &quot;Ngolo KANTE&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 13,
          &quot;position&quot;: &quot;Midfield&quot;
        },
        {
          &quot;name&quot;: &quot;Lucas HERNANDEZ&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 21,
          &quot;position&quot;: &quot;Defender&quot;
        }
      ],
    },
    { &quot;home_team&quot;: False,
      &quot;away_team&quot;: True,
      &quot;country&quot;: &quot;Australia&quot;,
      &quot;num_passes&quot;: 390,
      &quot;passes_completed&quot;: 332,
      &quot;fouls_committed&quot;: 19,
      &quot;colors&quot;: [&quot;green&quot;, &quot;gold&quot;],
      &quot;players&quot;: [
        {
          &quot;name&quot;: &quot;Mathew RYAN&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 1,
          &quot;position&quot;: &quot;Goalie&quot;
        },
        {
          &quot;name&quot;: &quot;Mark MILLIGAN&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 5,
          &quot;position&quot;: &quot;Defender&quot;
        },
        {
          &quot;name&quot;: &quot;Mathew LECKIE&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 7,
          &quot;position&quot;: &quot;Forward&quot;
        },
        {
          &quot;name&quot;: &quot;Robbie KRUSE&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 10,
          &quot;position&quot;: &quot;Forward&quot;
        },
        {
          &quot;name&quot;: &quot;Andrew NABBOUT&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 11,
          &quot;position&quot;: &quot;Forward&quot;
        },
        {
          &quot;name&quot;: &quot;Aaron MOOY&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 13,
          &quot;position&quot;: &quot;Midfield&quot;
        },
        {
          &quot;name&quot;: &quot;Mile JEDINAK&quot;,
          &quot;captain&quot;: True,
          &quot;shirt_number&quot;: 15,
          &quot;position&quot;: &quot;Midfield&quot;
        },
        {
          &quot;name&quot;: &quot;Aziz BEHICH&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 16,
          &quot;position&quot;: &quot;Defender&quot;
        },
        {
          &quot;name&quot;: &quot;Joshua RISDON&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 19,
          &quot;position&quot;: &quot;Defender&quot;
        },
        {
          &quot;name&quot;: &quot;Trent SAINSBURY&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 20,
          &quot;position&quot;: &quot;Defender&quot;
        },
        {
          &quot;name&quot;: &quot;Tom ROGIC&quot;,
          &quot;captain&quot;: False,
          &quot;shirt_number&quot;: 23,
          &quot;position&quot;: &quot;Midfield&quot;
        }
      ]
    }
  ]
  </code></pre>
  <p>Given instructions:</p>
  <p>Iterate over the soccer_match list to create a new list with the information for each of the away team players whose position is &quot;Forward&quot;</p>
  <p>What i've done:</p>
  <pre><code>away_team_forwards = []
  away_team_players = []
  
  # Your code here
  for i in soccer_match:
      if i[&quot;away_team&quot;]== True:
          away_team_players.extend(i[&quot;players&quot;])
          for player in away_team_players:
              if player[&quot;position&quot;] == &quot;Forward&quot;:
                  away_team_forwards.extend(player)
                  
  away_team_forwards
  </code></pre>
  <p>Output:</p>
  <pre><code>['name',
   'captain',
   'shirt_number',
   'position',
   'name',
   'captain',
   'shirt_number',
   'position',
   'name',
   'captain',
   'shirt_number',
   'position']
  </code></pre>
  <p>Desired Output:</p>
  <pre><code>[{'name': 'Mathew LECKIE',
     'captain': False,
     'shirt_number': 7,
     'position': 'Forward'},
    {'name': 'Robbie KRUSE',
     'captain': False,
     'shirt_number': 10,
     'position': 'Forward'},
    {'name': 'Andrew NABBOUT',
     'captain': False,
     'shirt_number': 11,
     'position': 'Forward'}]
  </code></pre>
  <p>My question is: Should I have created a new list (away_team_players)?</p>