Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 12, 2023
commit ed46580ba11c24b492e23052bcd2e50a2c45dcd2
4 changes: 2 additions & 2 deletions physics/coulombs_law.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def coulombs_law(q1: float, q2: float, radius: float) -> float:
"""
Calculate the electrostatic force of attraction or repulsion
between two point charges

>>> coulombs_law(15.5,20,15)
12382849136.06
>>> coulombs_law(1,15,5)
Expand All @@ -37,7 +37,7 @@ def coulombs_law(q1: float, q2: float, radius: float) -> float:
"""
if radius <= 0:
raise ValueError("The radius is always a positive non zero integer")
return round(((8.9875517923 * 10**9) * q1 * q2) / (radius**2),2)
return round(((8.9875517923 * 10**9) * q1 * q2) / (radius**2), 2)


if __name__ == "__main__":
Expand Down