Python: How to calculate simple interest

Program 9. Write a python program to input principle (amount), time and rate (P, T, R) from user and find Simple Interest. How to calculate simple interest in python programming.

Logic to find simple interest in python program.

For Example
Input
Enter principle: 1200
Enter time: 2
Enter rate: 5.4
Output
Simple Interest = 129.600006

Formula for simple interest is given by –
SI=P*R*T/100
Where,
P is the principle amount
T is the time and
R is the rate
Logic to calculate simple interest
Step by step descriptive logic to calculate simple interest –
1. Input principle amount in some variable say principle.
2. Input time in some variable say time.
3. Input rate in some variable say rate.
4. Now, apply the formula to calculate simple interest i.e.
SI = (principle * time * rate) / 100.
5. Finally print the resultant value of SI.
”’

# Let us code for Solution:

print(“\n\t\t\t https://learnpythonforcbse.wordpress.com/”)
#Input principle, rate and time
print(“Enter principle (amount): “)
principle=float(input())
print(“Enter time: “)
time=float(input())
print(“Enter rate: “)
rate=float(input())

#Calculate simple interest
SI = (principle * time * rate) / 100;

print(“Simple Interest = “, SI)
print(“\n\t\t\t https://learnpythonforcbse.wordpress.com/”)

OUTPUT:

prog9.png