From 9f473a183c5b82fd1a156483f5d2251a87191a7c Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 19 May 2020 11:50:31 +0200 Subject: [PATCH 1/2] Precision must be a nonnegative integer --- maths/bailey_borwein_plouffe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maths/bailey_borwein_plouffe.py b/maths/bailey_borwein_plouffe.py index 7834668864af..50a53c793867 100644 --- a/maths/bailey_borwein_plouffe.py +++ b/maths/bailey_borwein_plouffe.py @@ -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 = ( From 8041c4b24eeccfece47ef43b965e29001171d570 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Tue, 19 May 2020 09:51:13 +0000 Subject: [PATCH 2/2] fixup! Format Python code with psf/black push --- data_structures/linked_list/singly_linked_list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data_structures/linked_list/singly_linked_list.py b/data_structures/linked_list/singly_linked_list.py index 516facc613eb..4377fc28022a 100644 --- a/data_structures/linked_list/singly_linked_list.py +++ b/data_structures/linked_list/singly_linked_list.py @@ -106,7 +106,7 @@ def __setitem__(self, index, data): 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