ps4d. I have a, b, and c correct, but my d is off after the second decimal place. can anyone figure our why? also I'm not quite understanding what epsilon is. Could someone please help with that too?
That's easy. Epsilon is the money left in your retirement account at the end of your retirement. In this case it´s close to zero, since you want to spend all your savings and leave nothing to your children (hence epsilon is 0.01). My answer is also off after the second decimal. I don't have an accurate answer but to tell you even the program code states that the value found ought to be close to 1229.95548986
I understand that it states it can be close, but for a, b, and c my answers were basically the same as the answers given so i thought that d should be that same way. By the way, thanks for the epsilon help
my answer to ps4d.py test is exactly 1229.95548986
double_o_seven: give us your code, please, so that we can help
what was your choice of starting high val and low val, vaboro?
jomarnavarro: if you mean the findMaxExpenses() function then starting low val is 0 and starting high val is the amount of money saved by the end of the work period or in the start of retirement period this choice of starting values basically means that yearly expenses during retirement period can be anything between 0 and the amount of money saved during work period I use the following variable declarations in my code: expenses_low = 0 expenses_high = retirement_fund The code is at the following URL: http://pastebin.com/sXpw7Y9E
I ran your code, and it gives exactly the same amount in the template. Mine gives a result a bit off, as I said earlier, but then again, who gets fractions of cents these days. I'd say it's significative enough. by the way, my code can be seen @ http://dpaste.com/550262/ Best Regards, Omar
Oops, I forgot to post my code. Sorry 'bout that. However, I just got it figured out and I got the same answer as the template so I think I'm good to go. Thanks anyway!
double_o_seven: I think I was wrong about your sense of humor
jomarnavarro: what does math.fabs() method do?
\[\nu \cos^{-1} \]
Join our real-time social learning platform and learn together with your friends!