KnowledgeBoat Logo

Computer Science

Write a program to compute simple interest and compound interest.

Python

Python Funda

CBSE

194 Likes

Answer

p = float(input("Enter principal: "))
r = float(input("Enter rate: "))
t = int(input("Enter time: "))
si = (p * r * t) / 100
ci = p * ((1 + (r / 100 ))** t) - p
print("Simple interest = ", si)
print("Compound interest = ", ci)

Output

Enter principal: 15217.75
Enter rate: 9.2
Enter time: 3
Simple interest =  4200.098999999999
Compound interest =  4598.357987312007

Answered By

108 Likes


Related Questions