Feb-12-2017, 04:32 PM
Ok so I have changed my code a bit but is still printing now -139 months which is wrong.
initial_balance = 1000 rate = 10 withdraw = 500 result = 1 target = result balance = initial_balance month = 1 while balance>result: interest = balance*rate/100 balance = balance - interest - withdraw month = month-interest if balance == month: print (month) print ("no of months is", month)