
Iordan G. answered 04/17/24
Machine learning researcher and data scientist using Python
Here's a start:
def futureInvestmentValue(investmentAmount, monthlyInterestRate, years):
return investmentAmount*((1 + monthlyInterestRate)**(years*12))
initial = input("Enter the investment amount: ")
annualInterestRate = input("Enter the annual interest rate: ")
for i in range(30):
value = futureInvestmentValue(float(initial), float(annualInterestRate)/12, i+1)
print(f"year: {i+1} \t value: {value}")