Created
October 16, 2013 22:01
-
-
Save CaryInVictoria/7015692 to your computer and use it in GitHub Desktop.
Future value problem
This file contains 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(pv, r, n): | |
return (pv * (1 + 0.01 * r) ** n) | |
pv = 100 | |
r = 0.5 | |
n = 12 | |
print("future_value(pv = {0:5.2f}, r = {1:3.2f}, n = {2:2}) = {3:5.2f}".format (pv, r, n, future_value(pv, r, n))) | |
# => future_value(pv = 100.00, r = 0.50, n = 12) = 106.17 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment