Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- balance = 5000
- annualInterestRate = 0.18
- minMonthlyPayment = round((0.02 * balance),2)
- interest = 0
- totalPaid = 0
- month = 1
- while month <=12:
- print 'Month: ' + str(month)
- print 'Minimum monthly payment: ' + str(minMonthlyPayment)
- interest = (balance - minMonthlyPayment) * (annualInterestRate/12)
- balance -= round(minMonthlyPayment + interest,2)
- totalPaid += minMonthlyPayment
- print 'Remaining balance: ' + str(balance)
- month += 1
- print 'Total paid: ' + str(totalPaid)
- print 'Remaining balance: ' + str(balance)
Advertisement
Add Comment
Please, Sign In to add comment