Compound interest
Take in the principle amount interest as % and duration of the investment in years return the accumulated amount
invest = float(input("Enter amount of investment: "))
interest = float(input("Enter interest (%): "))
duration = int(input("Enter duration of the investment in years: "))
accum = 0
for i in range(duration):
accum = ((invest * interest) / 100)
invest += accum
print("\nAccumulated amount: %.2f" % invest)
Comments
Leave a comment