Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 17 Online
OpenStudy (anonymous):

Could anyone help me on the Ps2 Problem 4? I cannot figure out how to use the given template to structure the code.

OpenStudy (anonymous):

have you read the readings? and tried the examples in the readings?

OpenStudy (anonymous):

Thanks for your kind reminder. @bwCA To specify my problem, the thing that I cannot understand is why this following line is in the template. packages = (6,9,20) # variable that contains package sizes I mean, isn’t the purpose of Problem 4 to find the answer for any three arbitrary sized packages instead of just in quantity of 6, 9, 20? Why do I still need to include it in my code?

OpenStudy (anonymous):

I agree yolandm. I actually wrote my code to request user input for three variables x, y, z and then assigned them to the 'packages' variable as a tuple: (x, y, z). During testing I used (6, 9, 20) because I knew the answer, but then I tested other combinations as well to see if my code worked for various input values.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!