Skip to content

Instantly share code, notes, and snippets.

@suchov
Created June 22, 2017 19:22
Show Gist options
  • Save suchov/65b865d796b14bfa44e348f678e8e5be to your computer and use it in GitHub Desktop.
Save suchov/65b865d796b14bfa44e348f678e8e5be to your computer and use it in GitHub Desktop.
year = 12
while year > 0:
monthlyInterestRate = annualInterestRate/12
minimumMonthlyPayment = monthlyPaymentRate * balance
monthlyUnpaidBalance = balance - minimumMonthlyPayment
balance = monthlyUnpaidBalance + (monthlyInterestRate * monthlyUnpaidBalance)
# print("Remaining balance: " + str(balance))
year -= 1
print("Remaining balance: " + str(round(balance, 2)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment