Apr-03-2019, 07:30 AM
I did not give any indication on where my beliefs stand. I am only asking explanations to what is written.
Then according to what you said, if I declare such variables globally (before the function itself)
I should be solving the problem, but instead nothing changes.
Here is my new code. I just placed the variables above.
Then according to what you said, if I declare such variables globally (before the function itself)
I should be solving the problem, but instead nothing changes.
Here is my new code. I just placed the variables above.
r=13.0 A=1000.0 balance=9999999999.0 def f(balance,r,n,A): 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)