Computer Science, asked by htsharma9412, 9 months ago

Q1 .WAP to find compound interest using phyton​

Answers

Answered by charu47Sa
0

Answer: output

Enter the principal amount: 100000

Enter the interest rate: 12

Enter the time in years: 5

Compound amount is 176234.17

Compound interest is 76234.17

Explanation:

def compound_interest(principle, rate, time):

   result = principle * (pow((1 + rate / 100), time))

   return result

p = float(input("Enter the principal amount: "))

r = float(input("Enter the interest rate: "))

t = float(input("Enter the time in years: "))

amount = compound_interest(p, r, t)

interest = amount - p

print("Compound amount is %.2f" % amount)

print("Compound interest is %.2f" % interest)

Similar questions