Hi all,
I am new to Python (really enjoying it so far) and am working my way through Learn Python the hard way. I have just learnt about functions and decided to go off piste and make myself a question to solve. I can't find the answer online, so was wondering if you good people can help me.
Problem PART A : I am trying to work out 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:
BigD :)
I am new to Python (really enjoying it so far) and am working my way through Learn Python the hard way. I have just learnt about functions and decided to go off piste and make myself a question to solve. I can't find the answer online, so was wondering if you good people can help me.
Problem PART A : I am trying to work out 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:
def mortgage(borrowed, repayment, interest, time): print(f"total left after {time} months \n") print(borrowed * (interest/12 +1)-repayment) #this calculates mortgage left after 1 month. How do I repeat this calculation on the answer? 71 times mortgage(200000,750,.03,72)Many Thanks,
BigD :)