Write a Python Code to Calculate simple interest and compound interest.

 

P = float(input("Enter Principle Amount :"))
R = float(input("Enter Rate of Interest :"))
T = float(input("Time (in Years)"))
n = float(input("Number of times interest is compounded per year :"))
t=T
SI = (P * R * T)/100
CI = P * (1+ (R/100*n))**n*t


print("Simple Interest :",SI)
print("Compound Interest :",CI)

Comments