title: python list controlled increment
body: <p>I'm trying to increment a python list of numbers like an abacus.</p>
  
  <pre><code>list = [0,0,0,0]
  units = 4
  
  def m(list, units):
    for e in range(len(list)):
      if units:
        list[e] = list[e] + 1
        units -= 1
  </code></pre>
  
  <p>This code works fine in that if I run <code>m(list, units)</code> the list will be [1,1,1,1] -- the problem I am trying to solve is that when the units value is something like <code>units = 2</code> the list will increment to [2,2,1,1] (which again is fine) the problem is when I run the <code>m()</code>function from an uneven list, the list will increment from list[0] to end up [3,3,1,1] rather than [2,2,2,2].  </p>
  
  <p><strong>Is there a pythonic way I can have the function increment the list from the lowest value to achieve an even spread?</strong></p>