Skip to content

Commit ab3400b

Browse files
cclaussgithub-actions
and
github-actions
authored
Travis CI: Fix Travis linter errors (TheAlgorithms#1802)
* Travis CI: Fix Travis linter errors * fixup! Format Python code with psf/black push * Update .travis.yml * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
1 parent 1bc84e1 commit ab3400b

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
os: linux
2+
dist: bionic
13
language: python
24
python: 3.8
35
cache: pip

DIRECTORY.md

+1
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@
321321
* [Newton Raphson](https://github.com/TheAlgorithms/Python/blob/master/maths/newton_raphson.py)
322322
* [Numerical Integration](https://github.com/TheAlgorithms/Python/blob/master/maths/numerical_integration.py)
323323
* [Perfect Square](https://github.com/TheAlgorithms/Python/blob/master/maths/perfect_square.py)
324+
* [Pi Monte Carlo Estimation](https://github.com/TheAlgorithms/Python/blob/master/maths/pi_monte_carlo_estimation.py)
324325
* [Polynomial Evaluation](https://github.com/TheAlgorithms/Python/blob/master/maths/polynomial_evaluation.py)
325326
* [Prime Check](https://github.com/TheAlgorithms/Python/blob/master/maths/prime_check.py)
326327
* [Prime Factors](https://github.com/TheAlgorithms/Python/blob/master/maths/prime_factors.py)

maths/pi_monte_carlo_estimation.py

+3-1
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)