{"record":{"id":"465798f833d0fd7d","repo":"TheAlgorithms/Python","slug":"one-and-only-one-argument-must-be-0-465798","errorCode":null,"errorMessage":"One and only one argument must be 0","messagePattern":"One and only one argument must be 0","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"physics/casimir_effect.py","lineNumber":91,"sourceCode":"\n    >>> casimir_force(force = 3457e-12, area = 0, distance = 0)\n    Traceback (most recent call last):\n        ...\n    ValueError: One and only one argument must be 0\n\n    >>> casimir_force(force = 3457e-12, area = 0, distance = -0.00344)\n    Traceback (most recent call last):\n        ...\n    ValueError: Distance can not be negative\n\n    >>> casimir_force(force = -912e-12, area = 0, distance = 0.09374)\n    Traceback (most recent call last):\n        ...\n    ValueError: Magnitude of force can not be negative\n    \"\"\"\n\n    if (force, area, distance).count(0) != 1:\n        raise ValueError(\"One and only one argument must be 0\")\n    if force < 0:\n        raise ValueError(\"Magnitude of force can not be negative\")\n    if distance < 0:\n        raise ValueError(\"Distance can not be negative\")\n    if area < 0:\n        raise ValueError(\"Area can not be negative\")\n    if force == 0:\n        force = (REDUCED_PLANCK_CONSTANT * SPEED_OF_LIGHT * pi**2 * area) / (\n            240 * (distance) ** 4\n        )\n        return {\"force\": force}\n    elif area == 0:\n        area = (240 * force * (distance) ** 4) / (\n            REDUCED_PLANCK_CONSTANT * SPEED_OF_LIGHT * pi**2\n        )\n        return {\"area\": area}\n    elif distance == 0:\n        distance = (","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/TheAlgorithms/Python/blob/f5988cc09713315817df6a7e327e258013a94440/physics/casimir_effect.py#L73-L109","documentation":"Error \"One and only one argument must be 0\" thrown in TheAlgorithms/Python.","triggerScenarios":"Thrown at physics/casimir_effect.py:91 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set exactly one of the arguments to 0 so it can be solved for."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f5988cc09713315817df6a7e327e258013a94440","analyzedAt":"2026-08-14T17:30:07.041Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}