I'm taking an intro to python class and i've run into a bit of a barrier. My assignement is listed below:
"Write a program that takes the following inputs: (i) an initial capital C, (ii) a yearly investment Y ,(iii) an interest rate (percentage) P, and (iv) a number of years N. The program should print a table of the future values for all years."
This is the actual code I have written so far:
print "This program calculates the future value of an initial capital, given a yearly investment, interest rate, and duration in years." c = initial_capital = input ("Enter the initial capital: ") y = yearly_investment = input ("Enter the yearly investment: ") i = irate = input ("Enter the interest rate: ") irate = irate/100.0 n = number_of_years = input ("Enter the number of years: ") for i in range (n): (c + y) * i d = (c + y) + ((c + y) * i) print "After year", n print "you'll have", d
#I guess my question is how to organize the program and how to get my for loop to work properly. Thanks for the help!
Editor: added code tags