diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bee8a64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__ diff --git a/lib/__pycache__/num_fns.cpython-310.pyc b/lib/__pycache__/num_fns.cpython-310.pyc deleted file mode 100644 index e058596..0000000 Binary files a/lib/__pycache__/num_fns.cpython-310.pyc and /dev/null differ diff --git a/lib/__pycache__/num_functions.cpython-310.pyc b/lib/__pycache__/num_functions.cpython-310.pyc deleted file mode 100644 index 07e2086..0000000 Binary files a/lib/__pycache__/num_functions.cpython-310.pyc and /dev/null differ diff --git a/lib/num_fns.py b/lib/num_fns.py index 3cc0f90..d7cedf3 100644 --- a/lib/num_fns.py +++ b/lib/num_fns.py @@ -1,2 +1,9 @@ def isDivBy(num, denom): return num % denom == 0 + +def fib(i): + if i == 1: + return 1 + elif i == 2: + return 2 + return fib(i - 1) + fib(i - 2) \ No newline at end of file diff --git a/src/problem2.py b/src/problem2.py index 97c41a9..d1bca97 100644 --- a/src/problem2.py +++ b/src/problem2.py @@ -1,13 +1,6 @@ import sys sys.path.append("lib") -from num_fns import isDivBy - -def fib(i): - if i == 1: - return 1 - elif i == 2: - return 2 - return fib(i - 1) + fib(i - 2) +from num_fns import isDivBy, fib sum = 0