title: Generate random numbers without using the last n values in Python
body: <p>I have a Python function that generates a random number between 0 and 100:</p>
  
  <pre><code>def get_next_number():
      value = randint(0,100)
  </code></pre>
  
  <p>Every time I call this function, I need it to return a random number but that number cannot be one of the last n random numbers it returned (lets say 5 for this example).</p>
  
  <p>Here are some examples:</p>
  
  <p>55, 1, 67, 12, 88, 91, 100, 54 (This is fine as there are no duplicates in the last 5 numbers returned)</p>
  
  <p>77, 42, 2, 3, 88, 2... (When the function gets a random number of 2, I need it to try again since 2 was already returned 3 numbers prior)</p>
  
  <p>89, 23, 29, 81, 99, 100, 6, 8, 23... (This one is fine because 23 occurred more than 5 times before)</p>
  
  <p>Is there something built into the random function to accomplish this?</p>