Excluding words in Conditions in Python
<p>I'm currently trying to write a program where I have several conditions.  I wanted to exclude a list of words (det) from a list of tokens. Up to <code>if len(W) &lt;=8:</code>, it worked just as I wanted it to. However, I could not get the program to find any of words in det in my list of tokens, and exclude them from the printing.</p>

<p>This is what I have currently: </p>

<pre><code>det = ['the','a',an','\'s']
w for w in tkV if w not in det
def BT_pos1(w):
  for w in tkV:
    if w.islower():
      if len(w) &gt;=3:
        if len(w) &lt;=8:
          if w not in det:
            print w, ' may be a bt.'
</code></pre>
