Created
December 17, 2013 20:04
-
-
Save weskerfoot/8011665 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pay(current_debt, amount): | |
return current_debt-amount | |
def next_year(previous_debt, amount, n): | |
if previous_debt <= 0: | |
return n | |
previous_debt = previous_debt + 0.068*previous_debt | |
previous_debt = pay(previous_debt, amount) | |
print previous_debt | |
return next_year(pay(previous_debt, amount), amount, n+1) | |
print next_year(32000, 3000, 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment