Skip to content

Instantly share code, notes, and snippets.

@CaryInVictoria
Created October 16, 2013 22:01
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 CaryInVictoria/7015692 to your computer and use it in GitHub Desktop.
Save CaryInVictoria/7015692 to your computer and use it in GitHub Desktop.
Future value problem
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