title: How to limit a number to be within a specified range? (Python)
body: <p>I want to limit a number to be within a certain range. Currently, I am doing the following:</p>
  
  <pre><code>minN = 1
  maxN = 10
  n = something() #some return value from a function
  n = max(minN, n)
  n = min(maxN, n)
  </code></pre>
  
  <p>This keeps it within <code>minN</code> and <code>maxN</code>, but it doesn't look very nice. How could I do it better?</p>
  
  <p>PS: FYI, I am using Python 2.6.</p>