for what the variables stand for, kindly refer to my first post of this thread.
n is used for the number of years and the question to be answered is: how much money do I still
own after n years have passed? (again, refer to my first post).
I have not used n yet because I don't know how to.
Momentarily I have erased it to try out your suggestion and this is the code I have.
However, it still does not work.
in order to make matters as clear as possible, I believe that is safe to say that the following code works
But this part of the code
n is used for the number of years and the question to be answered is: how much money do I still
own after n years have passed? (again, refer to my first post).
I have not used n yet because I don't know how to.
Momentarily I have erased it to try out your suggestion and this is the code I have.
However, it still does not work.
def f(balance,r,A): r=13.0 A=1000.0 balance=9999999999.0 return (balance)*(r/100.0 +1) - A while balance>0: balance-=f(balance,r,n,A) balance=round(balance,2) if balance<0: balance=0 print(balance)
in order to make matters as clear as possible, I believe that is safe to say that the following code works
def f(balance,r,A): r=13.0 A=1000.0 balance=9999999999.0 return (balance)*(r/100.0 +1) - Ain fact if I want to print out the value
print(f(balance,r,A))I obtain 11299998998.869999.
But this part of the code
while balance>0: balance-=f(balance,r,n,A) balance=round(balance,2) if balance<0: balance=0 print(balance)keeps giving me the same issue.