title: IndexError: list index out of range with nested list
body: <pre><code>for i in list404:
      for j in range(len(table)):
          if table[j][0] == i:
              table.remove(table[j])
      for k in range(len(stack)):
          if stack[k][0] == i:
              stack.remove(stack[k])
      for l in range(len(symbols)):
          if symbols[l] == i:
              symbols.remove(symbols[l])
  </code></pre>
  
  <p>list404 is a list of stocks. I'd like to remove the stocks inside the table, stack and symbols with the name shows up in the list404. The table and stack are the nested list I guess. The structure is like this: [[a, b, c], [a, b, c], [a, b, c]]. All I want is to check whether a is in the list404. If it exist, remove the whole list from table.</p>
  
  <p>Here's the error. IndexError: list index out of range in if table[j][0] == i:</p>
  
  <p>Can anyone help me with it??? Thx!</p>