title: Python For Loop iterating X times values in list issue
body: <pre><code>listA = [(UK,1),(USA,2),(UAE,3)]
  def fetchdata():
    base_url = 'someurl.com
    params = {countryname : country}
    resp = requests.requests('GET', base_url+params).json()
  
  def upload():
   some sql insert code
  for x in lista:
     country = listA[0]
     ID = listA[1]
     fetchdata()
     upload()
  </code></pre>
  <p>Above code works fine. The issue is, because there's three tuples, the SQL will upload data 3 times. If I have five tuples, it will upload data five times. I tried nested list, no luck.</p>
  <p>My intention is such that UK will be inserted in JSON parameter, it will fetch data, assign ID/index, upload to SQL the two values. Then it will loop for next country.</p>
  <p>What I should get is....</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Country</th>
  <th>ID</th>
  <th>value</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>UK</td>
  <td>1</td>
  <td>50</td>
  </tr>
  <tr>
  <td>US</td>
  <td>2</td>
  <td>100</td>
  </tr>
  <tr>
  <td>UAE</td>
  <td>3</td>
  <td>75</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>What I am getting is....</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Country</th>
  <th>ID</th>
  <th>value</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>UK</td>
  <td>1</td>
  <td>50</td>
  </tr>
  <tr>
  <td>UK</td>
  <td>1</td>
  <td>50</td>
  </tr>
  <tr>
  <td>UK</td>
  <td>1</td>
  <td>50</td>
  </tr>
  <tr>
  <td>US</td>
  <td>2</td>
  <td>100</td>
  </tr>
  <tr>
  <td>US</td>
  <td>2</td>
  <td>100</td>
  </tr>
  <tr>
  <td>US</td>
  <td>2</td>
  <td>100</td>
  </tr>
  <tr>
  <td>UAE</td>
  <td>3</td>
  <td>75</td>
  </tr>
  <tr>
  <td>UAE</td>
  <td>3</td>
  <td>75</td>
  </tr>
  <tr>
  <td>UAE</td>
  <td>3</td>
  <td>75</td>
  </tr>
  </tbody>
  </table>
  </div>