title: How to use: while not in
body: <p>I'm trying to check if a list has no member as boolean operator AND, OR, NOT.</p>
  
  <p>I use:</p>
  
  <pre><code>while ('AND' and 'OR' and 'NOT') not in list:
    print 'No boolean operator'
  </code></pre>
  
  <p>However, when my input is: <code>a1 c2 OR c3 AND</code>, it prints 'No boolean operator', which means this list is considered no boolean operator in it by using above loop sentence.</p>
  
  <p>Hope somebody can help to correct.</p>
  
  <p>Thanks,
  Cindy</p>