Question: # futval.py # A program to compute the value of an investment # carried 10 years into the future def main(): print This program calculates
# futval.py # A program to compute the value of an investment # carried 10 years into the future def main(): print "This program calculates the future value" print "of a 10 year investment." principal = input("Enter the initial principal: ") apr = input("Enter the annualized interest rate: ") for i in range(10): principal = principal * (1 + apr) print "The value in 10 years is:", principal main()
Write an improved python version of thefutval.py program. Your program will prompt for amount of investment, annualized interest rate, and number of years of investment. The program will then output a nicely formatted table that tracks the value of investment year by year (for 30 years), both to the screen, and to a csv file. For the csv file, start with $10,000 and an interest rate of 2%.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
