135k views
2 votes
Write a python program to calculate the compound interest

User Nfelger
by
5.7k points

1 Answer

3 votes

Answer:

initialPrincipal = float(input("Please enter your initial principal:"))

interestRate = float(input("Please enter your interest rate:"))

timePeriod = float(input("Please enter your number of times interest applied per time period:"))

elapsedPeriod = float(input("Please enter your number of time period elapsed:"))

finalAmount = initialPrincipal*(1 + interestRate/timePeriod)^(timePeriod*elapsedPeriod)

print("Your final amount would be:", finalAmount)

User Sketchthat
by
5.6k points