Python Program to Calculate Simple Interest
In this post, we will be learning how to write a Python Program to Calculate Simple Interest of the given values of Principle, Time and Rate.
The formula to Calculate Simple Interest
To calculate S.I, we have a formula:-
S.I represents Simple Interest,
P represents Principle,
R represents Rate (annually),
T represents Time (in years).
# Taking an input for principle (p) p = float(input("Enter the principle: ")) # Taking an input for rate per year (r) r = float(input("Enter the rate: ")) # Taking an input for time (t) t = float(input("And Enter the time(in years): ")) # formula for Simple Interest (si) is (p*r*t)/100 si = (p*r*t)/100 # printing the simple interest print("The S.I is",si)
Enter the rate: 5
And Enter the time(in years): 2
The S.I is 500.0
That was all about this program. If you find any problem you can comment below.
Latest posts by Amit Rawat (see all)
- Python Program to Display or Print Prime Numbers Between a Range or an Interval - June 18, 2019
- Python Program To Print Pascal’s Triangle (2 Ways) - June 17, 2019
- Python program to print Floyd’s Triangle (3 Ways) - June 15, 2019