Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mir = annualInterestRate / 12
- low = balance/12
- high = (balance*(1 + mir)**12)/12
- epsilon = 0.01
- mp = (high + low)/2.0
- ob = balance
- while abs(balance) >= epsilon:
- balance = ob
- for month in range(0, 12):
- balance = (balance - mp) * (1+mir)
- if balance > 0:
- low = mp
- else:
- high = mp
- mp = (high + low)/2.0
- else: print "Lowest Payment: " + str(round(mp, 2))
Add Comment
Please, Sign In to add comment