Guest User

Untitled

a guest
Jan 17th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. class debt:
  2.     def calc():
  3.         balance = 3926
  4.         initialBalance = balance
  5.         annualInterestRate = 0.2
  6.         monthlyInterestRate = annualInterestRate/12
  7.         minimumMonthlyPayment = 10
  8.         while (balance > 0):
  9.             for i in range(12):
  10.                 balance = round((balance-minimumMonthlyPayment)*(1+monthlyInterestRate), 2)
  11.             if (balance > 0):
  12.                 minimumMonthlyPayment +=10
  13.                 balance = initialBalance
  14.         print "Lowest Payment: ", minimumMonthlyPayment
  15.     calc()
Add Comment
Please, Sign In to add comment