From c4268ddf9bcac0f69b838699074f6eea71ae7cc2 Mon Sep 17 00:00:00 2001 From: shriranga Date: Tue, 6 Aug 2024 17:13:33 +0530 Subject: [PATCH 1/3] Created Investment Rules folder and added a snippet to calulate time take to double your investments --- INVESTMENT_RULES/README.md | 13 +++++++++++++ INVESTMENT_RULES/rule_of_72.py | 11 +++++++++++ 2 files changed, 24 insertions(+) create mode 100644 INVESTMENT_RULES/README.md create mode 100644 INVESTMENT_RULES/rule_of_72.py diff --git a/INVESTMENT_RULES/README.md b/INVESTMENT_RULES/README.md new file mode 100644 index 00000000..0a85c11d --- /dev/null +++ b/INVESTMENT_RULES/README.md @@ -0,0 +1,13 @@ +## 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/ \ No newline at end of file diff --git a/INVESTMENT_RULES/rule_of_72.py b/INVESTMENT_RULES/rule_of_72.py new file mode 100644 index 00000000..82e3d58b --- /dev/null +++ b/INVESTMENT_RULES/rule_of_72.py @@ -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): + # It will get the time zone of the user location + 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") \ No newline at end of file From f81809d8ee6e705e693f9b6fac2f53cc5b868eec Mon Sep 17 00:00:00 2001 From: shriranga Date: Tue, 6 Aug 2024 18:11:42 +0530 Subject: [PATCH 2/3] Updated the README.md and the script to include more details --- INVESTMENT_RULES/README.md | 4 +++- INVESTMENT_RULES/rule_of_72.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/INVESTMENT_RULES/README.md b/INVESTMENT_RULES/README.md index 0a85c11d..d1cbd737 100644 --- a/INVESTMENT_RULES/README.md +++ b/INVESTMENT_RULES/README.md @@ -1,4 +1,6 @@ -## What Is the Rule of 72? +# List of python scripts that auomates calculation of really handful of Investment Rules. + +## 1. 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 diff --git a/INVESTMENT_RULES/rule_of_72.py b/INVESTMENT_RULES/rule_of_72.py index 82e3d58b..f1b4f1f3 100644 --- a/INVESTMENT_RULES/rule_of_72.py +++ b/INVESTMENT_RULES/rule_of_72.py @@ -3,9 +3,9 @@ def calculate_time_taken_to_double(fixed_interest_rate): - # It will get the time zone of the user location + # 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") \ No newline at end of file +print(f"Your investment will take {time_taken_to_double} year(s) to double!") \ No newline at end of file From ca78b555b4ceb823b215b535da62428eee7158fc Mon Sep 17 00:00:00 2001 From: Mallikarjun Date: Wed, 7 Aug 2024 17:33:23 +0530 Subject: [PATCH 3/3] Added a new Investment Rules snippet to calculate Real Inflation adjested return --- INVESTMENT_RULES/README.md | 15 ++++++++++++++- INVESTMENT_RULES/inflation_adjusted_return.py | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 INVESTMENT_RULES/inflation_adjusted_return.py diff --git a/INVESTMENT_RULES/README.md b/INVESTMENT_RULES/README.md index d1cbd737..99198579 100644 --- a/INVESTMENT_RULES/README.md +++ b/INVESTMENT_RULES/README.md @@ -12,4 +12,17 @@ ### 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/ \ No newline at end of file +For more details refer https://www.investopedia.com/ask/answers/what-is-the-rule-72/ + +## 2. Real Rate of Return adjusted to Inflation + You know that investments have to do more than keep pace with inflation for you to build wealth. As Golden says, + “A dollar today is not worth a dollar in the future.” But how do you determine what your investment return is after inflation? + This equation helps you compute your real return, or your return adjusted for inflation. + + For example, if an investment returns 8 percent, and inflation is 3 percent, this is how you’d set up the problem: + [ ( 1.08 ÷ 1.03 ) - 1 ] x 100 = 4.85 percent real return + + “You’re losing to inflation every year,” says Charles Sachs, a wealth manager at Kaufman Rossin Wealth in Miami. + “Long term, inflation runs about 3 percent. So your money buys half as much in 20 years.” + + Learn more here--> https://finance.yahoo.com/news/6-investment-formulas-financial-success-172744221.html \ No newline at end of file diff --git a/INVESTMENT_RULES/inflation_adjusted_return.py b/INVESTMENT_RULES/inflation_adjusted_return.py new file mode 100644 index 00000000..6a59cd2f --- /dev/null +++ b/INVESTMENT_RULES/inflation_adjusted_return.py @@ -0,0 +1,18 @@ +Inflation_Adjsted_Return_Summary = """ +Learn More about this investment rule in README.md located in INVESTMENT_RULES folder** + """ + +print(Inflation_Adjsted_Return_Summary) + +# Get the Avg Investment Rate of Return and Avg Inflation Rate +invest_rate_return = float(input("What is expected average Rate of Return (don't use % sign): "))/100 +avg_inflration_rate = float(input("What is your avg inflation rate?: "))/100 + + +def inflation_adjusted_return(invest_rate_return, avg_inflration_rate): + # Simple formula is : ((1 + Investment return percentage) / (1 + Inflation rate percentage) - 1) x 100 + inflration_adjusted_return_val = (((1 +invest_rate_return )/(1 +avg_inflration_rate)) - 1) * 100 + return inflration_adjusted_return_val + +real_return = round(inflation_adjusted_return(invest_rate_return, avg_inflration_rate),2) +print(f"Your Actual Rate of Return adjusted to the inflation is {real_return}%. Not {invest_rate_return*100}% ") \ No newline at end of file