title: python: list assignment index out of range
body: <pre><code>  for row in c:
      for i in range(len(row)):
        if i not in keep:
          del row[i]
  </code></pre>
  
  <p>i am getting this error on the last line:</p>
  
  <pre><code>IndexError: list assignment index out of range
  </code></pre>
  
  <p>i dont understand how it can be out of range if it exists! please help</p>