title: How to randomly partition a list into n nearly equal parts?
body: <p>I have read the answers to the <a href="https://stackoverflow.com/questions/2659900/slicing-a-list-into-n-nearly-equal-length-partitions">Slicing a list into n nearly-equal-length partitions [duplicate]</a> question.</p>
  
  <p>This is the <a href="https://stackoverflow.com/questions/2659900/python-slicing-a-list-into-n-nearly-equal-length-partitions/2660034#2660034">accepted answer</a>:</p>
  
  <pre><code>def partition(lst, n): 
      division = len(lst) / float(n) 
      return [ lst[int(round(division * i)): int(round(division * (i + 1)))] for i in xrange(n) ]
  </code></pre>
  
  <p>I am wondering, how does one modify these solutions in order to randomly assign items to a partition as opposed to incremental assignment.</p>