yearly = float(input("Enter the investment: ")) apr = float(input("Enter the annual interest rate: ")) years = int(input("Enter the number of years: ")) year = 0 if year < years: year = year + 1 total = 0 for i in range(years): total = yearly print(total* (1 + (apr*year))) total *= 1 + (apr*years) print("The total value is ", total)