Jun-23-2018, 01:21 PM
(This post was last modified: Jun-23-2018, 01:21 PM by gontajones.)
So...
def mortgage(borrowed, repayment, interest, time): print(f"total left after {time} months \n") while (time > 0): borrowed = borrowed * (1 + interest / 12) borrowed = borrowed - repayment time -= 1 print(borrowed) mortgage(200000, 750, .03, 72)It's not necessary to use a for loop.