Skip to content

Instantly share code, notes, and snippets.

Created February 11, 2013 19:43
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 anonymous/4756990 to your computer and use it in GitHub Desktop.
Save anonymous/4756990 to your computer and use it in GitHub Desktop.
v_bal = f_bal = 20000
for i in range(10):
v_bal += 5200
f_bal += 5200
v_bal *= 1.05
f_bal *= 1.05
if i == 0:
v_cost = 75 + 25*5
else:
v_cost = 26*5
v_cost += v_bal*0.0018
f_cost = f_bal*0.0076
v_bal -= v_cost
f_bal -= f_cost
print "* Year {0}. Vanguard. This year's cost: {1:.2f}. This year's ending balance: {2:.2f}".format(i+1, v_cost, v_bal)
print "* Year {0}. Fidelity. This year's cost: {1:.2f}. This year's ending balance: {2:.2f}".format(i+1, f_cost, f_bal)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment