title: Python find fixed payment for compound monthly interest
body: <p>I was asked to write a program that calculates the minimum fixed monthly payment needed in order pay off a credit card balance within 12 months. By a fixed monthly payment, I mean a single number which does not change each month, but instead is a constant amount that will be paid each month. The fixed payment must be a multiple of 10, so a negative ending balance at the end of the year is fine. </p>
  
  <pre><code>balance = 3329; annualInterestRate = 0.2
  month=1
  monthlyInterest = (annualInterestRate)/12.0
  totbalance = balance*(pow(1+monthlyInterest, 12))
  fixedPayment = 10
  endbalance = totbalance
  while (endbalance - (fixedPayment * 12)) &gt;= 0:
      if (endbalance - (fixedPayment * 12)) == 0:
          break
      else:
          fixedPayment+=10
  print "Lowest Payment: ", fixedPayment
  </code></pre>
  
  <p>The fixed monthly payment I have is constantly greater than what the correct answer is, so I think it might be a problem with my loop, or my compound interest formula. However I checked online and I think I have expressed the formula in the correct way. 
  I know it has been asked before, but I would just like to understand what is wrong with this approach. Thanks! </p>