Skip to content

Instantly share code, notes, and snippets.

@lucpet
Created October 18, 2013 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucpet/7039442 to your computer and use it in GitHub Desktop.
Save lucpet/7039442 to your computer and use it in GitHub Desktop.
Question 6
def future_value(present_value, annual_rate, periods_per_year, years):
'''
>>> future_value(500, .04, 10, 10)
745.317442824
'''
rate_per_period = annual_rate / periods_per_year
periods = periods_per_year * years
future_value = present_value * (1 + rate_per_period) ** periods
return future_value
print "$1000 at 2% compounded daily for 3 years yields $", future_value(1000, .02, 365, 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment