Jun-25-2018, 04:49 PM
Hi,
So yesterday some kind people on this forum helped me solve this problem:
Problem PART A : How much of my mortgage is left after X months of repayment. In this case, amount borrowed - 200000, Interest rate 0.03 per anum, time: 72 months, paying back 750 a month.
Part B) Is there a formulae I can use to figure out how many months will it take to complete repayment if I am paying back at 750 a month (I solved it by brute force.)
Part C) How much would I have to repay each month to pay the mortgage back in 20 years (240months). Is there a formulae I can use?
Answer to A:
So yesterday some kind people on this forum helped me solve this problem:
Problem PART A : How much of my mortgage is left after X months of repayment. In this case, amount borrowed - 200000, Interest rate 0.03 per anum, time: 72 months, paying back 750 a month.
Part B) Is there a formulae I can use to figure out how many months will it take to complete repayment if I am paying back at 750 a month (I solved it by brute force.)
Part C) How much would I have to repay each month to pay the mortgage back in 20 years (240months). Is there a formulae I can use?
Answer to A:
def mortgage(borrowed, repayment, interest, time):
print(f"total left after {time} months \n")
for month in range(months):
borrowed -= repayment
borrowed *= (1 + interest / 12)
print(borrowed)For answer B I added:print (month,borrowed)
if borrowed <=0 :
print (month, borrowed)
break
