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).
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
Comments
Leave a comment