Formula for compound interest :

| = | final amount | |
| = | initial principal balance | |
| = | interest rate | |
| = | number of times interest applied per time period | |
| = | number of time periods elapsed |
def compound_interest(principle, rate, time):
CI = principle * (pow((1 + rate / 100), time))
print("Compound interest : ", CI)
p=int(input("Enter Principal amount: "))
r=int(input("Enter interest rate: "))
t=int(input("Enter time period: "))
compound_interest(p, r, t)

Leave a comment