Skip to content

Instantly share code, notes, and snippets.

@brenolf
Created February 14, 2016 21:50
Show Gist options
  • Save brenolf/7ea14b607f952d488b12 to your computer and use it in GitHub Desktop.
Save brenolf/7ea14b607f952d488b12 to your computer and use it in GitHub Desktop.
Calculation for retirement/investment
monthly_investment = 2 # x1000
savings = 0
years = 0
while savings < 1000:
savings = (savings + 12 * monthly_investment) * 1.05
years += 1
print years, savings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment