title: How to decrement a values of variable in python?
body: <p>Does anyone here who can help me what is the shortest way of decrementing a values of a variable?</p>
  
  <p>Below is my desired output:</p>
  
  <pre><code>start = 5000
  range = 5
  qout = start/range
  
  Distributed      Remaining
  1000             4000  # start - 1000
  1000             3000  # 4000 - 1000
  1000             2000  # 3000 - 1000
  1000             1000  # 2000 - 1000
  1000             0     # 1000 - 1000
  </code></pre>
  
  <p>what i have done so far is this:</p>
  
  <pre><code>start = 5000
  range = 5
  qout = start/range
  i = 0
  while i &lt; range:
      temp = {
              'distr' : qout,
              'remain' : start - remain, # This is what i can do only, unless it is being saved in the database so that i can move to next item.
              }
      i+=1
  return temp
  </code></pre>
  
  <p>RE UPDATED:</p>
  
  <p>I guess you are right, i don't know how should i ask. But let me show my original code.</p>
  
  <pre><code>temp = {}
  i =  0
  seq = 0
  start = 11529.60 
  range = 6
  qout = start / range
  remaining = start - qout
  while i &lt; range:
      while remaining &gt;= 0:
          temp = {
                   'sequence' : i+1,
                   'distributed' : qout,
                   'remaining' : remaining,
                 }
           remaining -= qout
      i += 1
   print(temp)
  </code></pre>
  
  <p>My expected output would like this <strong>(and this is the output that i wanted/desired to show)</strong></p>
  
  <pre><code>Sequence     Distributed      Remaining
  1            1921.60          9608.00
  2            1921.60          7686.40
  3            1921.60          5764.80
  4            1921.60          3843.20
  5            1921.60          1921.60
  6            1921.60          0.00
  </code></pre>
  
  <p>How ever this is what i get:</p>
  
  <pre><code>Sequence     Distributed      Remaining
  1            1921.60          9608.00
  1            1921.60          7686.40
  1            1921.60          5764.80
  1            1921.60          3843.20
  1            1921.60          1921.60
  </code></pre>
  
  <p><strong>Thanks for any help</strong></p>