In this python basic program, we will calculate compound interest using formula p*((1+r/100)**n).
Steps to solve the program
- Take the principal amount, rate of interest, and a number of years as input through the user.
- Calculate the compound interest using the formula p((1+r/100)**n).
- Print the output.
p = int(input("Enter principle amount: "))
r = float(input("Enter interest rate: "))
n = int(input("Enter number of years: "))
amount = p*((1+r/100)**n)
print("Compoud interest: ",amount)
Output :
Enter principle amount: 10000
Enter interest rate: 10
Enter number of years: 2
Compoud interest: 12100.000000000002