Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x=balance
- m=annualInterestRate/12
- x1=balance / 12
- x2=(balance * (1 + m)**12)/12
- updatedBalance = balance
- while abs(x1-x2)>0.0001:
- x=(x1+x2)/2
- updatedBalance = balance
- for _ in xrange(12):
- updatedBalance = (updatedBalance - x) * (1 + m)
- if updatedBalance>0:
- x1=x
- elif updatedBalance<0:
- x2=x
- print 'Lowest Payment: ', round(x,2)
Add Comment
Please, Sign In to add comment