Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- monthlyInteresstRate = annualInterestRate/12
- remainingBalance = balance
- higher = (remainingBalance * (1 + monthlyInteresstRate)**12)/12
- lower = remainingBalance/12
- monthly_Payment = (higher + lower) / 2
- start = True
- while start:
- monthly_Payment = (higher + lower) / 2
- remainingBalance = balance
- for i in range(0, 12):
- monthlyInterestRate = annualInterestRate/12
- remainingBalance = (remainingBalance - monthly_Payment) * (1 + monthlyInterestRate)
- if remainingBalance <= 0:
- break
- if (higher - lower < 0.005):
- print "Lowest Payment: ", round(monthly_Payment, 2)
- for i in range(0, 12):
- monthlyInterestRate = annualInterestRate/12
- remainingBalance = (remainingBalance - monthly_Payment) * (1 + monthlyInterestRate)
- print monthlyInterestRate
- if remainingBalance <= 0:
- break
- break
- elif balance < 0:
- higher = monthly_Payment
- else:
- lower = monthly_Payment
Add Comment
Please, Sign In to add comment