Untitled
unknown
python
a month ago
876 B
1
Indexable
Never
def sort(width, height, length, mass): volume = width * height * length is_bulky = volume >= 1000000 or width >= 150 or height >= 150 or length >= 150 is_heavy = mass >= 20 if is_bulky and is_heavy: return "REJECTED" elif is_bulky or is_heavy: return "SPECIAL" else: return "STANDARD" # Test cases print(sort(100, 100, 100, 10)) # Should return "STANDARD" print(sort(200, 50, 50, 10)) # Should return "SPECIAL" (bulky) print(sort(100, 100, 100, 25)) # Should return "SPECIAL" (heavy) print(sort(150, 150, 150, 25)) # Should return "REJECTED" (both bulky and heavy) print(sort(149, 149, 149, 19)) # Should return "STANDARD" (just under limits) print(sort(150, 1, 1, 1)) # Should return "SPECIAL" (one dimension is 150) print(sort(10, 10, 10000, 5)) # Should return "SPECIAL" (volume over 1,000,000)
Leave a Comment