Created
February 14, 2016 21:50
-
-
Save brenolf/7ea14b607f952d488b12 to your computer and use it in GitHub Desktop.
Calculation for retirement/investment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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