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)
could you post the actual question as well please?
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.
Join our real-time social learning platform and learn together with your friends!