Skip to content

Instantly share code, notes, and snippets.

@LittleHaku
Created November 8, 2019 23:07
Show Gist options
  • Select an option

  • Save LittleHaku/4c64011a1ea880dbcc417d36f0a17008 to your computer and use it in GitHub Desktop.

Select an option

Save LittleHaku/4c64011a1ea880dbcc417d36f0a17008 to your computer and use it in GitHub Desktop.
def nb_year(p0, percent, aug, p, n=0):
while p0 < p:
n += 1
total = p0 + int(p0*(percent/100)) + aug
p0 = total
else:
return n
print(nb_year(1000, 2, 50, 1200))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment