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:
1 2 3 4 5 6 7 8 |
S.I = (P*R*T)/100 Where, S.I represents Simple Interest, P represents Principle, R represents Rate (annually), T represents Time (in years). |
Write a Python Program to Compute Simple Interest
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# 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) |
Output:
1 2 3 4 5 6 |
Enter the principle: 5000 Enter the rate: 5 And Enter the time(in years): 2 The S.I is 500.0 |