title: Removing tuples from a list
body: <p>I'm trying to remove a tuple from a list.  If the first element in the list equals "-NONE-" I want to remove the whole tuple.  I keep getting an error when I try different things.  Here's what I have:</p>
  
  <pre><code>def filter(sent):
      for tuple in sent:
          if tuple[1] == "-NONE-":
              sent.remove(sent.index(tuple))
  </code></pre>
  
  <p>I'm using this test to call the method:</p>
  
  <pre><code>filter([('uh', 'UH'), ('i', 'PRP'), ('think', 'VBP'), (',', ','), ('*0*', '-NONE-'), ('it', 'PRP'), ("'s", 'BES'), ('because', 'IN'), ('i', 'PRP'), ('get', 'VBP'), ('*', '-NONE-'), ('to', 'TO'), ('be', 'VB'), ('something', 'NN'), ('that', 'WDT'), ('i', 'PRP'), ("'m", 'VBP'), ('not', 'RB'), ('*T*', '-NONE-'), ('.', '.')])
  </code></pre>
  
  <p>but I keep getting this error:</p>
  
  <pre><code>Traceback (most recent call last):
  File "&lt;pyshell#273&gt;", line 1, in &lt;module&gt;
  filter([('uh', 'UH'), ('i', 'PRP'), ('think', 'VBP'), (',', ','), ('*0*', '-NONE-'), ('it', 'PRP'), ("'s", 'BES'), ('because', 'IN'), ('i', 'PRP'), ('get', 'VBP'), ('*', '-NONE-'), ('to', 'TO'), ('be', 'VB'), ('something', 'NN'), ('that', 'WDT'), ('i', 'PRP'), ("'m", 'VBP'), ('not', 'RB'), ('*T*', '-NONE-'), ('.', '.')])
  File "&lt;pyshell#272&gt;", line 4, in filter
    sent.remove(sent.index(tuple))
  ValueError: list.remove(x): x not in list
  </code></pre>