Simple interest
Simple interest is a simple way to calculate the interest on a loan. Simple interest is determined by multiplying the principal by the daily interest rate multiplied by the number of days elapsed between payments. – Investopedia
Logic
After taking input (Principle, Rate, Time) from the user we have to use a very simple formula shown below:
Simple interest formula
Where, P = Principle, T = Time and R = Rate
To calculate simple interest we have to multiply principal, rate and time, then divide it by 100 and print the result.
Program
# Take inputs from user principal = float(input("Enter principal : ")) rate = float(input("\nEnter rate : ")) time = float(input("\nEnter time (year) : ")) # Calculate simple interest result = (principal * rate * time) / 100 # Print the result print("\nSimple interest :", result)
Output
Enter principal : 1000
Enter rate : 4
Enter time (year) : 2
Simple interest : 80.0