Skip to content

Commit 5f1b772

Browse files
github-actionsgithub-actions
github-actions
authored and
github-actions
committed
fixup! Format Python code with psf/black push
1 parent 5aa53ea commit 5f1b772

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

maths/pi_monte_carlo_estimation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def random_unit_square(cls):
1818
"""
1919
Generates a point randomly drawn from the unit square [0, 1) x [0, 1).
2020
"""
21-
return cls(x = random.random(), y = random.random())
21+
return cls(x=random.random(), y=random.random())
22+
2223

2324
def estimate_pi(number_of_simulations: int) -> float:
2425
"""
@@ -56,6 +57,7 @@ def estimate_pi(number_of_simulations: int) -> float:
5657

5758
# doctest.testmod()
5859
from math import pi
60+
5961
prompt = "Please enter the desired number of Monte Carlo simulations: "
6062
my_pi = estimate_pi(int(input(prompt).strip()))
6163
print(f"An estimate of PI is {my_pi} with an error of {abs(my_pi - pi)}")

0 commit comments

Comments
 (0)