Advertisements
Advertisements
प्रश्न
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.
संक्षेप में उत्तर
Advertisements
उत्तर
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 (-,+,*,/,%)
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
