title: Random contiguous slice of list in Python based on a single random integer
body: <p>Using a single random number and a list, how would you return a random slice of that list?</p>
  
  <p>For example, given the list <code>[0,1,2]</code> there are <em>seven</em> possibilities of random contiguous slices:</p>
  
  <ol>
  <li><code>[ ]</code></li>
  <li><code>[ 0 ]</code></li>
  <li><code>[ 0, 1 ]</code></li>
  <li><code>[ 0, 1, 2 ]</code></li>
  <li><code>[ 1 ]</code></li>
  <li><code>[ 1, 2]</code></li>
  <li><code>[ 2 ]</code></li>
  </ol>
  
  <p>Rather than getting a random starting index and a random end index, there must be a way to <strong>generate a single random number</strong> and use that one value to figure out both starting index and end/length. </p>
  
  <p>I need it that way, to ensure these 7 possibilities have equal probability.</p>