मराठी

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 - Computer Science (Python)

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.0
shaalaa.com
Operators - Arithmetic Operators (-,+,*,/,%)
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 5: Getting Started with Python - Exercise [पृष्ठ ११७]

APPEARS IN

एनसीईआरटी Computer Science [English] Class 11
पाठ 5 Getting Started with Python
Exercise | Q 11. | पृष्ठ ११७
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×