def validate_height(value: str) -> bool:
    """value must be xxxcm or xxin:
    if cm, must be 150-193, else 59-76"""
    try:
        if value.endswith("cm"):
            return int(value[:-2]) in range(150, 194)
        elif value.endswith("in"):
            return int(value[:-2]) in range(59, 77)
        return False
    except (TypeError, ValueError):
        return False