title: Deleting items from a list as a "trigger" for a while loop
body: <p>I want to do this:</p>
  
  <pre><code>while list:
      for blah in blah:
          things
      list.remove(min(list))
  </code></pre>
  
  <p>Would this loop until all the items in list are removed? As i have it my code, it just loops through [list] times, and then returns from the function. I need a loop that will keep going until all the items of list are gone.</p>
  
  <p>I should note, nothing inbetween (in the for loop) is processed until the last iteration.</p>
  
  <p>By request, the entire algorithm as it runs:</p>
  
  <pre><code>def parsexlsx(address):
      bits = [] 
      i = 0
      while address:
          min_address = False
          for row in ws.iter_rows(row_offset=4,column_offset=3):
              c = row[2]
              d = row[3]
              if not d.internal_value:
                  if min_address:     #we set it to true, then kept going until blank row
                      break           #bits is what you want it to be now
                  bits = []           #reset bits every time we hit a new row
                  continue            #this will just skip to next row
  
              for bits_cell in row[4:]:
                  if bits_cell.internal_value:
                      bits.append(bits_cell.internal_value)
              if c.internal_value:
                  if c.internal_value == min(address):
                      min_address = True
          address.remove(min(address))
  
      print bits
      return bits 
  </code></pre>