title: Multiple logical comparisons on a single line for an if statement
body: <p>I want to do multiple comparisons for a logical condition in python but I am not sure of the right way round for the <code>and</code> and <code>or</code>. I have 2 statements. </p>
  
  <p>Statement 1:</p>
  
  <pre><code>#if PAB is more than BAC and either PAB is less than PAC or PAC is more than BAC
  if PAB &gt; BAC and PAB&lt; PAC or PAB &gt; BAC and PAC&gt;BAC: 
  </code></pre>
  
  <p>Statement 2:</p>
  
  <pre><code>#if PAB is more than BAC and PAC is less than PAB or if PAB is less than BAC and PAC is less than BAC
  if PAB &gt;BAC and  PAC&lt;PAB or PAB&lt;BAC and  PAC&lt;BAC
  </code></pre>
  
  <p>Is or-ing the two ands the correct way to go about it?</p>
  
  <p>Thanks.</p>