Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- balance = 3926
- annualInterestRate = 0.2
- monthlyPayment = 0
- initial_balance = balance
- while balance > 0 and not math.isinf(balance):
- monthlyPayment += 10
- balance = initial_balance
- for i in range(1,13):
- if i < 13:
- balance -= monthlyPayment
- balance += annualInterestRate / 12 * balance
- print balance
- print monthlyPayment
- # print ("Lowest Payment:", monthlyPayment)
- # initBalance = balance
- # monthlyInterestRate = annualInterestRate / 12.0
- # month = 0
- # minPay = 10
- # def calculate(month, balance, minPay, monthlyInterestRate):
- # while month <12:
- # unpaidBalance = balance - minPay
- # balance = unpaidBalance + (monthlyInterestRate * unpaidBalance)
- # month += 1
- # return balance
- # while calculate(month, balance, minPay, monthlyInterestRate) > 0:
- # balance = initBalance
- # minPay +=10
- # month = 0
- # calculate(month, balance, minPay, monthlyInterestRate)
- # print('Lowest Payment: ' + str(minPay))
- # initBalance = balance
- # monthlyInterestRate = annualInterestRate / 12.0
- # month = 0
- # minPay = 10
- # def calculate(month, balance, minPay, monthlyInterestRate):
- # while month <12:
- # unpaidBalance = balance - minPay
- # balance = unpaidBalance + (monthlyInterestRate * unpaidBalance)
- # month += 1
- # return balance
- # while calculate(month, balance, minPay, monthlyInterestRate) > 0:
- # balance = initBalance
- # minPay +=10
- # month = 0
- # calculate(month, balance, minPay, monthlyInterestRate)
- # print('Lowest Payment: ' + str(minPay))
- # monthlyInterestRate = annualInterestRate / 12.0
- # upr = balance *
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement