Problem 35 Savings Calculators

Back to Problem Solutions forum

ChillFruit     2016-08-10 00:36:49

So I had tried to do it using simple math with logs to find the years, taking care to round it up appropriately. I got the very last entry to fail (by one), so I make a second code using the looping method that was probably intended, since rounding could have been hurting me. only to find the exact same value as I had found.

I refreshed the page and got a new test data and using my old code, it passed. So, I don't know. Since one point of data hardly matters it was

Input: 100 1600 1

My output: 279

Requested output: 280

Quandray     2016-08-10 06:37:05
User avatar

Hi,

My code gives 280. Are you rounding down to whole cents each year?

ChillFruit     2016-08-10 12:24:01

Yup, although I have used Python's native rounding function, so maybe that's the issue? I just rebuilt it using a different rounding algorithm and I got 280. I do wonder why it only not worked with one value out of like 32.

Please login and solve 5 problems to be able to post at forum