Programming Examples
Create a Python program to calculate simple interest using user input for principal
Create a Python
program to calculate simple interest using user input for principal and
literals/constants for rate and time. Ensure the constants are well-defined,
and the output is clearly formatted.
SolutionRATE = 8.5 # Annual Rate of Interest (in %)
TIME = 3 # Time in Years
principal = float(input("Enter the Principal Amount: "))
simple_interest = (principal * RATE * TIME) / 100
total_amount = principal + simple_interest
print("\n------ Simple Interest Details ------")
print("Principal Amount : Rs.", principal)
print("Rate of Interest : ", RATE, "%")
print("Time : ", TIME, "Years")
print("Simple Interest : Rs.", simple_interest)
print("Total Amount : Rs", total_amount)
▶ RUN Output/ Explanation: