I did a work for school which I had to submit on a website that verificated if the output requested matched mine. Well,the program is about compond interests: I had to create something that given a certain debt,interest and number of years without paying would print,for every year the acumulating debt.
Everything was just fine until I got a value of 850.85 when it should be 850.86. It is really annoying because due to this round error the code is checked as wrong and I will have 0 on this. Can you help me figuring out what is wrong?
ValorInicial=float(input())#inicial debt
Juro=(int(input()))#interest on a scale 1 to 100
AnosNãoPagos=int(input())#years without paying
Taxa=(Juro/100)
print("Crescimento da divida ao longo de",AnosNãoPagos,"anos:")
print(ValorInicial)
while AnosNãoPagos!=0:
ValorInicial=ValorInicial+ValorInicial*Taxa
AnosNãoPagos=AnosNãoPagos-1
value=round((ValorInicial),2)
print(value)