Skip to content

Commit 44868ea

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent c105f86 commit 44868ea

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

physics/hookes_law.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Hookes Law
1+
# Hookes Law
22
"""
33
Hookes Law states that the Force is directly proportional to the extension or compression of an elastic object, provided the limit of proportionality is not exceeded.
44
@@ -14,7 +14,8 @@
1414
1515
"""
1616

17-
def hookes_law(k:float, x:float) ->float:
17+
18+
def hookes_law(k: float, x: float) -> float:
1819
"""
1920
Calculate the Hookes law from the given values of spring constant 'k'
2021
and the displacement 'x' from the equilibrium position.
@@ -26,13 +27,10 @@ def hookes_law(k:float, x:float) ->float:
2627
>>> hookes_law(300, 3)
2728
-900
2829
"""
29-
return round(-k*x, 2)
30+
return round(-k * x, 2)
3031

3132

32-
if __name__ == "__main__":
33+
if __name__ == "__main__":
3334
import doctest
34-
35-
doctest.testmod()
36-
37-
3835

36+
doctest.testmod()

0 commit comments

Comments
 (0)