Created
October 18, 2013 10:13
-
-
Save lucpet/7039442 to your computer and use it in GitHub Desktop.
Question 6
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 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