Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. # In 000's
  2. pv = 400
  3. savings_rate = 0.10
  4. ir = 0.025
  5. periodicity = 4
  6. years = 20
  7.  
  8. cf = pv * savings_rate
  9. nper = periodicity * years
  10. irper = ir / periodicity
  11. cfper = cf / periodicity
  12.  
  13. terminal_value = pv * (1 + irper) ** nper
  14. sum_of_cfs = 0
  15.  
  16. for n in range(nper):
  17. this_cf = cfper * ((1 + irper) ** n)
  18. print("CF in period %d = %0.2f" % (n, this_cf))
  19. sum_of_cfs += this_cf
  20.  
  21. fv = terminal_value + sum_of_cfs
  22.  
  23. print("FV of savings = ${:,.2f}".format(fv))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement