my code is off by 10 compared to other test cases, but not all the time, any ideas?
balance = 4157
annualInterestRate = 0.18
payment = 10
def payforyear(x):
count = 0
while count < 12:
x = (x - payment) + (x*(annualInterestRate / 12))
count = count + 1
if count == 12:
return x
while payforyear(balance) > 0:
payment = payment + 10
else:
print ('Lowest payment: ' +str(payment) )

Hey! We 've verified this expert answer for you, click below to unlock the details :)

I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!

Looking for something else?

Not the answer you are looking for? Search for more explanations.

## More answers

Looking for something else?

Not the answer you are looking for? Search for more explanations.