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)
▶ RUN

Output/ Explanation:

Latest Current Affairs 2026 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad