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.

Solution

RATE = 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)
Output

Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad