Could anyone help me on the Ps2 Problem 4? I cannot figure out how to use the given template to structure the code.
have you read the readings? and tried the examples in the readings?
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?
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.
Join our real-time social learning platform and learn together with your friends!