title: complex if statement in python
body: <p>I need to realize a <em>complex</em> if-elif-else statement in Python but I don't get it working.</p>
  
  <p>The elif line I need has to check a variable for this conditions:</p>
  
  <p><strong>80, 443 or 1024-65535 inclusive</strong></p>
  
  <p>I tried </p>
  
  <pre><code>if
    ...
    # several checks
    ...
  elif (var1 &gt; 65535) or ((var1 &lt; 1024) and (var1 != 80) and (var1 != 443)):
    # fail
  else
    ...
  </code></pre>