So I did write a thing that successfully accomplishes what we were asked to do in question 2, but then I noticed the template provided has a for n in range thing... I have no idea how to incorporate that. I did it with a loop that would repeat every time the number of consecutive possible answers was less than the size of the smallest box...and I can't really see any other way of looking at it. Help?
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
Here is the beginning of the Python Tutorial in the online documentation - section 4.2 and 4.3 talk about for and range
I tried your code and didn't get an answer. most solutions for this i have seen for this problem involve three nested loops, one each for a, b, and c - trying various combinations of boxes to see if n nuggets can be bought.
whoops sorry, that link is http://docs.python.org/tutorial/
Not the answer you are looking for? Search for more explanations.
I just tried it on every three numbers I could think of it and it gave me a correct answer for each of them. Trying to redo my test with a for loop I guess.
if it works no need to change it, I tried it with 6, 9 and 12 but you are correct it works with 6, 9, and 20. nested (for) loops do come up often as solutions but I don't think you are required to use them if you can find another way.
Hi I am kinda stuck on this one as well. I wrote my code but I am getting wrong results. It is giving me 73 as the largest unbuyable size instead of 43. I tried to debug a bit but vouldnt find my way out.
Pasting tinypaste link here as well. Thanks for all the help in advance. http://tinypaste.com/6ceb2
@Rmood I would not change counting variables "manually" in a for loop.(i, j, k) Let the for loop handle incrementing those variables and either set a flag or break from the loop when you have reached a goal.