title: Can Python generate a random number that excludes a set of numbers, without using recursion?
body: <p>I looked over <a href="http://docs.python.org" rel="noreferrer">Python Docs</a> (I may have misunderstood), but I didn't see that there was a way to do this (look below) without calling a recursive function.<br>
  What I'd like to do is generate a random value which excludes values in the middle.</p>
  
  <p>In other words,<br>
  Let's imagine I wanted <code>X</code> to be a random number that's not in<br>
  <code>range(a - b, a + b)</code><br>
  Can I do this on the first pass,<br>
  or<br>
  1. Do I have to constantly generate a number,<br>
  2. Check if in <code>range()</code>,<br>
  3. Wash rinse ?</p>
  
  <p>As for why I don't wish to write a recursive function,<br>
   1. it 'feels like' I should not have to<br>
   2. the set of numbers I'm doing this for could actually end up being quite large, and<br>
  ... I hear stack overflows are bad, and I might just be being overly cautious in doing this.  </p>
  
  <p>I'm sure that there's a nice, Pythonic, non-recursive way to do it.</p>