{"record":{"id":"8a4bb06c6c6cef61","repo":"TheAlgorithms/Python","slug":"the-radius-is-always-a-positive-non-zero-integer","errorCode":null,"errorMessage":"The radius is always a positive non zero integer","messagePattern":"The radius is always a positive non zero integer","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"physics/centripetal_force.py","lineNumber":42,"sourceCode":"def centripetal(mass: float, velocity: float, radius: float) -> float:\n    \"\"\"\n    The Centripetal Force formula is given as: (m*v*v)/r\n\n    >>> round(centripetal(15.5,-30,10),2)\n    1395.0\n    >>> round(centripetal(10,15,5),2)\n    450.0\n    >>> round(centripetal(20,-50,15),2)\n    3333.33\n    >>> round(centripetal(12.25,40,25),2)\n    784.0\n    >>> round(centripetal(50,100,50),2)\n    10000.0\n    \"\"\"\n    if mass < 0:\n        raise ValueError(\"The mass of the body cannot be negative\")\n    if radius <= 0:\n        raise ValueError(\"The radius is always a positive non zero integer\")\n    return (mass * (velocity) ** 2) / radius\n\n\nif __name__ == \"__main__\":\n    import doctest\n\n    doctest.testmod(verbose=True)\n","sourceCodeStart":24,"sourceCodeEnd":50,"githubUrl":"https://github.com/TheAlgorithms/Python/blob/f5988cc09713315817df6a7e327e258013a94440/physics/centripetal_force.py#L24-L50","documentation":"Error \"The radius is always a positive non zero integer\" thrown in TheAlgorithms/Python.","triggerScenarios":"Thrown at physics/centripetal_force.py:42 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a positive non-zero 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-15T17:31:12.345Z"}