anonymous
  • anonymous
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?
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
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.
katieb
  • katieb
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
http://tinypaste.com/538a3
anonymous
  • anonymous
Here is the beginning of the Python Tutorial in the online documentation - section 4.2 and 4.3 talk about for and range file:///C:/Users/Bill/Documents/Python%20Docs/python-2.7.1-docs-html/tutorial/index.html 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.
anonymous
  • anonymous
whoops sorry, that link is http://docs.python.org/tutorial/

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
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.
anonymous
  • anonymous
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.
anonymous
  • anonymous
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
anonymous
  • anonymous
@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.

Looking for something else?

Not the answer you are looking for? Search for more explanations.