Product can withstand drops up to 100 cm

  Blog    |     February 11, 2026

To address the factory's misunderstanding of the "drop test," we need to implement a function that accurately simulates the test. The function should determine if a product passes or fails based on whether the drop height exceeds the product's maximum withstandable strength. Here's the solution:

def drop_test(strength, drop_height):
    """
    Determines if a product passes the drop test.
    Args:
        strength (int): Maximum height (in cm) the product can withstand without breaking.
        drop_height (int): Height (in cm) from which the product is dropped.
    Returns:
        bool: True if the product passes (does not break), False otherwise.
    """
    return drop_height <= strength

Explanation:

  1. Parameters:

    • strength: The maximum height (in cm) the product can endure without breaking. This is a fixed property of the product.
    • drop_height: The height (in cm) from which the product is dropped during the test.
  2. Logic:

    • The product passes if the drop_height is less than or equal to strength (i.e., the product survives the drop).
    • The product fails if the drop_height exceeds strength (i.e., the product breaks).
  3. Return Value:

    • Returns True for a pass (product survives).
    • Returns False for a fail (product breaks).

Example Usage:

# Test cases
print(drop_test(product_strength, 50))   # True (pass: 50 <= 100)
print(drop_test(product_strength, 100))  # True (pass: 100 <= 100)
print(drop_test(product_strength, 150))  # False (fail: 150 > 100)

Key Insight:

The factory's misunderstanding likely stems from not recognizing that the product's strength defines the safe drop limit. By comparing drop_height directly to strength, the function ensures accurate pass/fail results, aligning with standard drop test protocols. This implementation prevents the factory from incorrectly interpreting results (e.g., assuming higher drop heights are acceptable).


Request an On-site Audit / Inquiry

SSL Secured Inquiry