could someone explain these numbers? shouldn't it be salary * .05(because the .05 is an automatic) + salary * saved(whatever you want to save + salary * saved(matched by the company) i dont get these numbers: End of year 1 F[0] = salary * save * 0.01 End of year 2 F[1] = F[0] * (1 + 0.01 * growthRate) + salary * save * 0.01 End of year 3 F[2] = F[1] * (1 + 0.01 * growthRate) + salary * save * 0.01
problem set 4 btw
i assumed that 'saved' was the total amount, yours and the companies contribution - it makes it easier if you do that
thanks i have it working but its not in a function and when i put it in a function it says that my list in undefined? but it works when its not in a function do you know whats up with that? salary = int(raw_input("Enter your salary: ")) save = int(raw_input("Enter the amount saved per year: ")) years = int(raw_input("How many years will you work: ")) growthRate = int(raw_input("What is the expected growthRate: ")) EofY = [] year1 = salary * save * .01 EofY.append(year1) for i in range(1,years): i = EofY[i-1] * (1 + .01 * growthRate) + year1 EofY.append(i)
yeah my bad, i just thought about it after posting that, i was missing a return statement when i put it in a function, thanks
Join our real-time social learning platform and learn together with your friends!