Compound/Simple Interest Calculation using Python3
COMPOUND/SIMPLE INTEREST CALCULATION in Python
Compound/Simple interest calculation:
- The user inputs the Principle Value.
- Then, he/she inputs the rate of interest in percentage.
- In the third line, he/she inputs the time interval.
- Then, he/she must input the compounding frequency.
- The output shows the Future Value and the Interest paid.
The image below is of Compound Interest Calculation:
The below is of Simple Interest Calculation:
A = P(1 + rt) Where A is the total amount P is for principal amount Interest amount is I here r is known as rate of interest t is the time period.
Special note: r is for the rate of interest in decimal and r= R/100 where R is interest rate in percentage.
Why Compound Interest is Important?
- Let’s say that an investment is done by you in an asset which returns, on average, 7% each year, and let’s say you invest Rs. 10,000 as Principle Value in the first year.
- One year later, you get Rs. 10,000 of your original investment, and Rs. 700 of growth.
- The second year, you now have Rs.11,449 (Rs.10,700 + Rs.10,700 * 7%)
- Over 40 years, the growth is quite large: your Principal Value Rs.10,000 investment is worth Rs.1,49,745!
- 1 year later, you barely find any difference between your original investment and the final value. But after 30 years, you had over 7 times your principal investment! That’s the power of compounding.
- Let’s take a look at the code snippet and its output.
How Simple Interest is different from Compound Interest?
- First, simple interest is the calculation of that interest which ignores the compounding effect.
- Second, simple interest doesn’t compound with each time period of a loan.
- Third, simple interest is advantageous for borrowers whereas compound interest is advantageous for lenders.
Python program to find out compound and simple interest rate
P=int(input("Input Principle Value: ")) R=int(input("Input Rate of Interest: ")) T=int(input("The Time Interval for which investment is done: ")) n=int(input("The Compound Frequency:")) R/=100 R=round(R,2) F1=P*((1+R/n)**(n*T)) I1=F1-P I1=round(I1,2) F1=round(F1,2) I2=P*R*T F2=P+I2 print("In Compound Method:") print(" Compound Interest:",I1) print(" Future Value:",F1) print("In Simple Method:") print(" Simple Interest:",I2) print(" Future Value:",F2)
Input Principle Value: 60000 Input Rate of Interest: 8 The Time Interval for which investment is done: 15 The Compound Frequency:2 In Compound Method: Compound Interest: 134603.85 Future Value: 194603.85 In Simple Method: Simple Interest: 72000.0 Future Value: 132000.0
Input Principle Value: 70000 Input Rate of Interest: 8.5 The Time Interval for which investment is done: 15 The Compound Frequency:2 In Compound Method: Compound Interest: 192172.27 Future Value: 262172.27 In Simple Method: Simple Interest: 94500.0 Future Value: 164500.0
- Duplicate Elements Removal of an Array or List using Python 3.6
- Clockwise & CounterClockwise Rotation of Matrix using Numpy in Python3