Answer to Question #309929 in Python for big eddy

Question #309929

You were asked to check if a box with given sides could fit into a package. 

Your function should have the following interface: 

def boxToPackageSizeMatchCheck(box, package): 

        

Where box and package are lists of 3 elements of integer numbers. Each element in the list represents width, height and dept.  

To make the task easier for you, we are going to compare only related pairs of width, height and dept (we cannot spin or rotate box or package).  


1
Expert's answer
2022-03-11T17:39:27-0500
def boxToPackageSizeMatchCheck(box, package): 
    i = 1
    j = 1
    for b in box:
        i = b * i
    for p in package:
        j = p * j
    if i < j:
        return True
    else:
        return False
    

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS