title: Storing values in different variables in nested for loop
body: <p>I'm currently writing a piece of code that loops through the rows and columns of a spreadsheet and then uses the value of the cell at row <code>r</code> and column <code>c</code> in the parameter of a function. I currently have it working as following:</p>
  
  <pre><code>for i in range (1, ws.max_row+1): 
      first_column = worksheet.cell(i,1).value
      second_column = worksheet.cell(i,2).value
      third_column = worksheet.cell(i,3).value
      result = functionX.create(first_column, second_column, third_column)
  </code></pre>
  
  <p>Where the index <code>i</code> loops through the rows in the sheet. I'm using the <code>worksheet.cell(row,column).value</code> function from the <code>openpyxl</code> library and store them in the <code>x_column</code> variables. Later, these variables get used as parameters in the <code>class.create()</code> function <strong>within the same for loop</strong>. </p>
  
  <p>However, what I would like to do is to keep track of the columns in the loop as well, with a separate index. Reason for this is that I would like to print out a message to the user when he an empty cell has been encountered at row <code>i</code> and column <code>j</code>. </p>
  
  <p>As a solution, I thought it could be useful to use a nested for loop to keep track of the columns:</p>
  
  <pre><code>for i in range (1, ws.max_row+1):
      for j in range (1,4):
          first_column = worksheet.cell(i,j).value
          second_column = worksheet.cell(i,j).value
          third_column = worksheet.cell(i,j).value
      result = functionX.create(first_column, second_column, third_column)
  </code></pre>
  
  <p>However, this will obviously not increment the index <code>j</code> within the same iteration of the second loop. Any idea how to solve this?</p>