hit counter

Timeline

My development logbook

Calculate Cash Flows in Python

Q: Bob began setting aside $5,000 per year in an equity fund at the age of 25. He has turned 30, and has just made another deposit into the fund. The fund has returned 4% annually. How much does Bob have in his account today?

A:

1
2
3
4
5
6
# contribution at age
>>> [(i, 5000)for i in range(25, 30+1)]
[(25, 5000), (26, 5000), (27, 5000), (28, 5000), (29, 5000), (30, 5000)]

>>> sum([5000*pow(1.05, i-25) for i in range(25, 30+1)])
34009.5640625