title: How to format multiple 'or' conditions in an if statement in Python
body: <p>I am new to Python and am trying to implement multiple 'or' conditions to a single variable. I would like to know and understand the best way to format the following:</p>
  
  <pre><code>if ((word &lt; 1) | (word &gt; 10)):
     print "\n\n\nThe word entered is not valid!"
     print "Words that are valid are 1,2,7,8,9 and 10"
  </code></pre>
  
  <p>I want to compare '1' to numbers 5-10. Would it be something along the lines of:</p>
  
  <pre><code> if ((word &lt; 1) | (word &gt; 10) and (word &lt; 1) | (word &gt;9) and (word &lt; 1) and etc...):
     print "The word entered is not valid!"
     print "Words that are valid are between 1,2,7,8,9 and 10"
  </code></pre>
  
  <p>Numbers 1,2,7,8,9 and 10 are valid. Numbers 3,4,5,and 6 must be checked as less than to the variable of 'word'.</p>
  
  <p>How would i do this?</p>