Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- balance = 999999
- annualInterestRate = 0.18
- balance2=balance
- low= balance / 12
- high=balance*((1 + annualInterestRate/12)**12 /12)
- ans=round((low+high)/2, 2)
- balance2=balance
- while balance2 > 0:
- for month in range(1, 13):
- balance2=(balance2- ans)*(1 + annualInterestRate/12)
- if balance2 < 0.01:
- break
- if balance2 > 0:
- low=ans
- elif balance2 < 0:
- high=ans
- ans=(low+high)/2
- balance2=balance
- else:
- ans=round(ans, 2)
- print('Lowest Payment: ' + str(ans))
Add Comment
Please, Sign In to add comment