From 4515cb97a11d2b3b5c002aa74390c4dffd08ef8a Mon Sep 17 00:00:00 2001 From: cornbread-eater <146371786+cornbread-eater@users.noreply.github.com> Date: Tue, 10 Oct 2023 10:22:57 -0700 Subject: [PATCH 1/2] Update primelib.py --- maths/primelib.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/maths/primelib.py b/maths/primelib.py index cf01750cf912..28c5e5083e0a 100644 --- a/maths/primelib.py +++ b/maths/primelib.py @@ -574,6 +574,11 @@ def fib(n): """ input: positive integer 'n' returns the n-th fibonacci term , indexing by 0 + + >>> fib(5) + 8 + >>> fib(99) + 354224848179261915075 """ # precondition @@ -589,3 +594,7 @@ def fib(n): fib1 = tmp return ans + +if __name__ == "__main__": + import doctest + doctest.testmod() From 3ac655af839cad4cf4d0a8dcab569583adc62af8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 10 Oct 2023 17:25:28 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- maths/primelib.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/maths/primelib.py b/maths/primelib.py index 28c5e5083e0a..d5c124255e56 100644 --- a/maths/primelib.py +++ b/maths/primelib.py @@ -574,7 +574,7 @@ def fib(n): """ input: positive integer 'n' returns the n-th fibonacci term , indexing by 0 - + >>> fib(5) 8 >>> fib(99) @@ -595,6 +595,8 @@ def fib(n): return ans + if __name__ == "__main__": import doctest + doctest.testmod()