title: Generating a list of random numbers, summing to 1
body: <ul>
  <li>This question is not a duplicate of <a href="https://stackoverflow.com/q/2640053/7758804">Getting N random numbers whose sum is M</a> because:
  <ol>
  <li><strong>Most</strong> answers there are about theory, not a specific coding solution in python to answer this question</li>
  <li>The accepted answer here is 5 years older than the one answer in the duplicate that answers this question.</li>
  <li>The duplicate accepted answer does not answer this question</li>
  </ol>
  </li>
  </ul>
  <hr />
  <p>How would I make a list of N (say 100) random numbers, so that their sum is 1?</p>
  <p>I can make a list of random numbers with</p>
  <pre><code>r = [ran.random() for i in range(1,100)]
  </code></pre>
  <p>How would I modify this so that the list sums to 1 (this is for a probability simulation).</p>