title: Check whether a number is in a given range: fails to print message as instructed
body: <p>I am trying to write a program in Python to check whether a number is in a given range and I want it to print a message when it's not. However, the following code I have come up with fails to print such a message (it works for the first two conditions, but not the third). I'd appreciate if someone could point out if there is a mistake in my code and also if there is a more efficient way to write it.</p>
  
  <pre><code>def range(a,b,n):
      if b &gt; a:
          if(n&gt;=a) and (n&lt;=b):
              print(n,"is within the range",a,"-",b)
      elif b &lt; a:
          if(n&gt;=b) and (n&lt;=a):
              print(n,"is within the range",a,"-",b)
      else:
          if (n&gt;a,b) or (n&lt;a,b):
              print(n, "is not within the range", a,"-",b)
  </code></pre>
  
  <p>When I test the code with</p>
  
  <pre><code>range(2,8,300)
  </code></pre>
  
  <p>it prints nothing when it should print <code>300 is not within the range 2 - 8</code>.</p>