Ask your own question, for FREE!
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW) 36 Online
OpenStudy (anonymous):

I'm having trouble with ps1-b, my code doesn't work for a monthly payment that's bigger than 10 $. But I don't know why. Can someone help me? balance = float(raw_input("Enter the outstanding balance: ")) an_int_rate = float(raw_input("Enter the annual interest rate as a decimal: ")) mon_int_rate = an_int_rate/12 mon_pay = 0; while balance > 0: mon_pay += 10 n = 0 while n < 12 and balance > 0: print mon_pay, n n += 1 interest = mon_int_rate * balance balance -= mon_pay balance += interest balance = round(balance,2)

OpenStudy (anonymous):

could you post the actual question as well please?

OpenStudy (anonymous):

Found my mistake. I used the "wrong" balance. Sorry I assumed that there are more people doing the same course (mit 6.00), that would know what I'm talking about.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!