title: Iterate through two keys in Python
body: <p>I'm looking forward to iterating through both my keys here(models and dealers) and recording that in a csv. Maybe because i'm new to py or the way i'm used to like in sql, i'm not quite getting the idea of looping through two keys and getting the data. currently i'm doing a basic loop to extract the data, Any insight on how to address this would be really helpful</p>
  <p>My code:</p>
  <pre><code>for x in data['models']:
     for y in data['models'][x]:
         fetch={'brand': x, 'model':y}
         resul.append(fetch)
  
  for a in data['dealers']:
     for b in data['dealers'][a]:
         fetch={'brand': a, 'dealer':b}
  </code></pre>
  <p>My input:</p>
  <pre><code>data={ 
   &quot;models&quot; : 
         {
            &quot;ford&quot; : [ &quot;ranger&quot;,&quot;mustang&quot;,&quot;ecosport&quot;,&quot;ikon&quot;],
          &quot;nissan&quot; : [&quot;gt&quot;,&quot;terrano&quot;],
          &quot;tesla&quot; : [&quot;cyber truck&quot;,&quot;model x&quot;,&quot;model s&quot;,&quot;model s2&quot;],
          &quot;honda&quot; : [&quot;civic&quot;, &quot;accord&quot;]
          },
      
   &quot;dealers&quot;:
          {
           &quot;tesla&quot;: [ &quot;california&quot;, &quot;newyork&quot;, &quot;ohio&quot;],
           &quot;ford&quot; : [&quot;new jersey&quot;,&quot;hongkong&quot;,&quot;beijing&quot;,&quot;delhi&quot;,&quot;telaviv&quot;,&quot;ottawa&quot;],
           &quot;gm&quot; : [&quot;new york&quot;,&quot;washington dc&quot;],
           &quot;nissan&quot; : [&quot;dubai&quot;,&quot;saudi arabia&quot;]
           }
  }
  </code></pre>
  <p>Output:</p>
  <pre><code>| brand | models | dealers|
  |-------|--------|---------|
  |ford   | ranger | new jery|
  |ford   | mustang| hongkong |
  |ford   | ecosport| beijing |
  |ford   | ikon    | delhi|
  |ford   |         | telaviv |
  |ford   |         | ottawa |
  |nissan | gt      | dubai |
  |nissan | terrano | saudi arabia|
  |tesla  |cyber truck| california|
  |tesla  | model x   | newyork   |
  |tesla  | model s   | ohio      |
  |tesla  | model s2  |           |
  |honda  | civic     |           |
  |honda  | accord    |           |
  |gm     | new york  |           |
  |gm     | washington dc|        |
  </code></pre>