# compound_interest.py print("Compound Interest calculator. FV = P(1+r/n)^nt") P = eval(input("Enter the principal, P: ")) r = eval(input("Enter the interest rate, r%: ")) r = r / 100 t = eval(input("Enter the time, t, in years: ")) n = eval(input("Enter the number of compoundings, n, per year: ")) print("Period\tInt.\tBalance") for period in range(1,n*t+1): I = P * r/n P = P + I print(f"{period:}\t{I:.2f}\t{P:.2f}") print() print(f"Future value: ${P:.2f}")