def nb_year(p0, percent, aug, p): years = 0 while p0 < p: years = years + 1 p0 = p0 + p0 * (percent * .01) + aug print(p0) return years print(nb_year(1500, 5, 100, 5000))
Standard input is empty
1675.0 1858.75 2051.6875 2254.271875 2466.98546875 2690.3347421875 2924.851479296875 3171.0940532617187 3429.648755924805 3701.1311937210453 3986.1877534070977 4285.497141077452 4599.771998131325 4929.760598037891 5276.248627939785 15