Given principle amount, rate and time and we have to find the compound interest in Python.
Calculate compound interest
To calculate compound interest, we use the following formula,
P(1 + R / 100)T
Where,
- P – Principle amount
- R – Rate of the interest, and
- T – Time in the years
Example:
Input:
p = 250000
r = 36
t = 1
# formula
ci = p * (pow((1 + r / 100), t))
print(ci)
Output:
339999.99999999994
Python program to find compound interest
Output
need an explanation for this answer? contact us directly to get an explanation for this answer