title: Divide the number into random number of random elements?
body: <p>If I need to divide for example 7 into random number of elements of random size, how would I do this? </p>
  
  <p>So that sometimes I would get [3,4], sometimes [2,3,1] and sometimes [2,2,1,1,0,1]?</p>
  
  <p>I guess it's quite simple, but I can't seem to get the results. Here what I am trying to do code-wise (does not work):</p>
  
  <pre><code>def split_big_num(num):
      partition = randint(1,int(4))
      piece = randint(1,int(num))
      result = []
      for i in range(partition):
          element = num-piece
          result.append(element)
          piece = randint(0,element)
  #What's next?
          if num - piece == 0:
              return result
      return result
  </code></pre>
  
  <p>EDIT: Each of the resulting numbers should be less than initial number and the number of zeroes should be no less than number of partitions.</p>