mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-17 14:58:10 +00:00
Fixes black failures (#1742)
This commit is contained in:
parent
32ceec550f
commit
80718bd880
|
@ -4,6 +4,7 @@
|
||||||
from numpy import pi, sqrt
|
from numpy import pi, sqrt
|
||||||
from random import uniform
|
from random import uniform
|
||||||
|
|
||||||
|
|
||||||
def pi_estimator(iterations: int):
|
def pi_estimator(iterations: int):
|
||||||
"""An implementation of the Monte Carlo method used to find pi.
|
"""An implementation of the Monte Carlo method used to find pi.
|
||||||
1. Draw a 2x2 square centred at (0,0).
|
1. Draw a 2x2 square centred at (0,0).
|
||||||
|
@ -15,7 +16,6 @@ def pi_estimator(iterations: int):
|
||||||
6. Print the estimated and numpy value of pi
|
6. Print the estimated and numpy value of pi
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
circle_dots = 0
|
circle_dots = 0
|
||||||
|
|
||||||
# A local function to see if a dot lands in the circle.
|
# A local function to see if a dot lands in the circle.
|
||||||
|
|
|
@ -38,7 +38,10 @@ def calculate_turnaround_times(
|
||||||
>>> calculate_turnaround_times([10, 3], [0, 10])
|
>>> calculate_turnaround_times([10, 3], [0, 10])
|
||||||
[10, 13]
|
[10, 13]
|
||||||
"""
|
"""
|
||||||
return [duration_time + waiting_times[i] for i, duration_time in enumerate(duration_times)]
|
return [
|
||||||
|
duration_time + waiting_times[i]
|
||||||
|
for i, duration_time in enumerate(duration_times)
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def calculate_average_turnaround_time(turnaround_times: List[int]) -> float:
|
def calculate_average_turnaround_time(turnaround_times: List[int]) -> float:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user