{"record":{"id":"83455eca930a2cb8","repo":"TheAlgorithms/Python","slug":"the-radius-is-always-a-positive-number","errorCode":null,"errorMessage":"The radius is always a positive number","messagePattern":"The radius is always a positive number","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"physics/coulombs_law.py","lineNumber":35,"sourceCode":"\ndef coulombs_law(q1: float, q2: float, radius: float) -> float:\n    \"\"\"\n    Calculate the electrostatic force of attraction or repulsion\n    between two point charges\n\n    >>> coulombs_law(15.5, 20, 15)\n    12382849136.06\n    >>> coulombs_law(1, 15, 5)\n    5392531075.38\n    >>> coulombs_law(20, -50, 15)\n    -39944674632.44\n    >>> coulombs_law(-5, -8, 10)\n    3595020716.92\n    >>> coulombs_law(50, 100, 50)\n    17975103584.6\n    \"\"\"\n    if radius <= 0:\n        raise ValueError(\"The radius is always a positive number\")\n    return round(((8.9875517923 * 10**9) * q1 * q2) / (radius**2), 2)\n\n\nif __name__ == \"__main__\":\n    import doctest\n\n    doctest.testmod()\n","sourceCodeStart":17,"sourceCodeEnd":43,"githubUrl":"https://github.com/TheAlgorithms/Python/blob/f5988cc09713315817df6a7e327e258013a94440/physics/coulombs_law.py#L17-L43","documentation":"Error \"The radius is always a positive number\" thrown in TheAlgorithms/Python.","triggerScenarios":"Thrown at physics/coulombs_law.py:35 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a positive radius."],"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"}