Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- balance = 320000
- annualInterestRate = 0.2
- _balance = balance
- interest = 0.0
- lower = balance/12
- upper = (balance*(1+annualInterestRate/12)**12)/12
- payment = round((lower+upper)/2,2)
- while True:
- balance = _balance
- mes = 1
- while mes < 13:
- interest = (balance - payment)*(annualInterestRate/12)
- balance = balance - payment + interest
- mes += 1
- if (upper-lower) <= 0.1:
- break
- elif balance > 0:
- lower = payment
- payment = round((payment+upper)/2,2)
- else:
- upper = payment
- payment = round((payment+lower)/2,2)
- print('Lowest Payment: ' + str(round(payment,2)) )
Add Comment
Please, Sign In to add comment