Python program to find Compound interest

In this example, we will learn how to find a compound interest using python.

In this program, we should know the formula and basic concepts to solve the question. 

Thus the formula of compound interest is:  P(1+R/100)* 


p = principal amount

R= rate of interest

T= time span


  1. Input the principal amount and rate of interest from the user.
  2. Input the time in years from the user.
  3. Using for loop, find the Compound Interest by simply using the above formula.
  4. Print the result.
  5. Exit 



n=int(input("Enter the principle amount:"))

rate=int(input("Enter the rate:"))

years=int(input("Enter the number of years:"))

for i in range(years):





Enter the principle amount:100

Enter the rate:2

Enter the number of years:2



Report Error/ Suggestion

Related Posts:

CopyRight © 2020

CopyRight © 2020