Hey I don't get how to do Problem 3 of pset 2. I don't know if it's necessary but here is my answer for problem 1 of pset 2. http://pastebin.com/N7gS2uvM and here is my code so far from problem 3 i keep getting no solution for all answers tho.
Just before pset2 prob 3 there is an explanation of how to write the code for prob 3 - try to turn it into a function. The theory is that if you can find 6 successive numbers of nuggets that you CAN buy then you can buy all numbers above that number. So just start at one, can you buy one? no, can you buy two? no ... keep increasing the number - every time you find a number you can't buy, save it. If the theory is true, eventually you will find six in a row that you CAN buy - you are done - the last number you saved (because you could NOT buy it) is the highest number of of nuggets you can't buy ... there are probably other ways to do it it helps to put print statements in your code to see what it is doing and see if it is doing what you want - print variables, print counters, print results of tests or calculations. you can always comment them out when they become obnoxious
Sorry I forgot to post the second link last night i have already started it i just keep getting no solution and i don't know why? http://pastebin.com/ypiRdb5k
Join our real-time social learning platform and learn together with your friends!