mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-30 22:23:42 +00:00
Precision must be a nonnegative integer (#2013)
* Precision must be a nonnegative integer * fixup! Format Python code with psf/black push Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
parent
e6fdcc90fd
commit
1c62bd10c1
|
@ -106,7 +106,7 @@ class LinkedList:
|
|||
raise IndexError("Index out of range.")
|
||||
current = current.next
|
||||
current.data = data
|
||||
|
||||
|
||||
def __len__(self):
|
||||
"""
|
||||
Return length of linked list i.e. number of nodes
|
||||
|
|
|
@ -39,7 +39,7 @@ def bailey_borwein_plouffe(digit_position: int, precision: int = 1000) -> str:
|
|||
if (not isinstance(digit_position, int)) or (digit_position <= 0):
|
||||
raise ValueError("Digit position must be a positive integer")
|
||||
elif (not isinstance(precision, int)) or (precision < 0):
|
||||
raise ValueError("Please input a nonnegative integer for the precision")
|
||||
raise ValueError("Precision must be a nonnegative integer")
|
||||
|
||||
# compute an approximation of (16 ** (n - 1)) * pi whose fractional part is mostly accurate
|
||||
sum_result = (
|
||||
|
|
Loading…
Reference in New Issue
Block a user