Skip to content

Created Investment Rules folder and added a python file to start with #396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions INVESTMENT_RULES/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# List of python scripts that auomates calculation of some really handful of Investment Rules.

## What Is the Rule of 72?
The Rule of 72 is a simple way to determine how long an investment will take to double given a fixed annual rate of interest. Dividing 72 by the annual rate of return gives investors a rough estimate of how many years it will take for the initial investment to duplicate itself.

### Key takeaways
The Rule of 72 is not precise, but is a quick way to get a useful ballpark figure.
For investments without a fixed rate of return, you can instead divide 72 by the number of years you hope it will take to double your money. This will give you an estimate of the annual rate of return you’ll need to achieve that goal.
The calculation is most accurate for rates of return of about 5% to 10%.
For more precise outcomes, divide 69.3 by the rate of return. While not as easy to do in one’s head, it is more accurate.

### How the Rule of 72 Works
For example, the Rule of 72 states that $1 invested at an annual fixed interest rate of 10% would take 7.2 years ((72 ÷ 10) = 7.2) to grow to $2.

For more details refer https://www.investopedia.com/ask/answers/what-is-the-rule-72/
11 changes: 11 additions & 0 deletions INVESTMENT_RULES/rule_of_72.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Get Aannual fixed interest rate
fixed_interest_rate = input("Please enter the Annual Fixed interest rate (don't use % sign): ")


def calculate_time_taken_to_double(fixed_interest_rate):
# A simple formula calulate the time it takes to double an investment.
time_taken = 72/float(fixed_interest_rate)
return time_taken

time_taken_to_double = round(calculate_time_taken_to_double(fixed_interest_rate),2)
print(f"Your investment will take {time_taken_to_double} year(s) to double!")