Advertisements
Advertisements
Question
Write a Python program to calculate the amount payable if money has been lent on simple interest. Principal or money lent = P, Rate of interest = R% per annum and Time = T years. Then Simple Interest (SI) = (P × R × T)/100.
Amount payable = Principal + SI.
P, R, and T are given as input to the program.
Answer in Brief
Advertisements
Solution
Program:
#Asking the user for Principal, rate of interest, and time
P = float(input('Enter the principal: '))
R = float(input('Enter the rate of interest per annum: '))
T = float(input('Enter the time in years: '))
#calculating simple interest
SI = (P * R * T)/100
#caculating amount = Simple Interest + Principal
amount = SI + P
#Printing the total amount
print('Total amount:',amount)
OUTPUT:
Enter the principal: 12500
Enter the rate of interest per annum: 4.5
Enter the time in years: 4
Total amount: 14750.0shaalaa.com
Operators - Arithmetic Operators (-,+,*,/,%)
Is there an error in this question or solution?
