1.Density less than 1 g/cm³or

  Blog    |     February 01, 2026

To solve the Fake Material Test, we need to determine if a given material is "fake" based on specific criteria. The criteria for a fake material are: 2. Melting point below 100°C.

Approach

The approach involves checking the material's properties against the given criteria:

  1. Check Density: If the material's density is less than 1 g/cm³, it is classified as fake.
  2. Check Melting Point: If the material's melting point is below 100°C, it is also classified as fake.
  3. Combined Check: If either of the above conditions is true, the material is fake. Otherwise, it is not fake.

Solution Code

def is_fake(material):
    """
    Determines if a material is fake based on density or melting point criteria.
    Args:
        material (dict): A dictionary containing material properties with keys:
            - 'density' (float): Density in g/cm³
            - 'melting_point' (float): Melting point in °C
    Returns:
        bool: True if the material is fake, False otherwise.
    """
    if material['density'] < 1 or material['melting_point'] < 100:
        return True
    return False

Explanation

  • Function Definition: The function is_fake takes a dictionary material as input, which must contain the keys 'density' and 'melting_point'.
  • Condition Check: The function checks if either the density is less than 1 g/cm³ or the melting point is below 100°C. If either condition is met, it returns True (indicating the material is fake).
  • Return Result: If neither condition is satisfied, the function returns False (indicating the material is not fake).

This approach efficiently evaluates the material against the specified criteria to determine if it is fake, ensuring clarity and correctness in the classification.


Request an On-site Audit / Inquiry

SSL Secured Inquiry