From f5b311e84630236f2ed4e2b19ab6fe6bfbccd8b7 Mon Sep 17 00:00:00 2001 From: t3xhno Date: Tue, 6 Feb 2024 14:45:15 +0100 Subject: [PATCH] Moved --- .gitignore | 1 + lib/__pycache__/num_fns.cpython-310.pyc | Bin 271 -> 0 bytes lib/__pycache__/num_functions.cpython-310.pyc | Bin 277 -> 0 bytes lib/num_fns.py | 7 +++++++ src/problem2.py | 9 +-------- 5 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 .gitignore delete mode 100644 lib/__pycache__/num_fns.cpython-310.pyc delete mode 100644 lib/__pycache__/num_functions.cpython-310.pyc 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 e058596d507ad51b7cc30d314f8186907d93edca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 271 zcmd1j<>g`kg8xQ`QcZ#MV-N=!FabFZKwQiNBvKes7+V;k7*d#m88n%bL2@tvVuP?V z5QEj$Fw`)L0o7-N)H3u2QWrs|iZR_F&5 z<);@V=H_PRr32ZC$t9V|srm&)`B|ySCGn}HIjKeZIhjfNKx5+5@{08eDsQo87Q1AY oIaM-(EC-p%!&t-yr2I4?G{PPTixnt$i^C>2KLu!-9YPla010I_hX4Qo diff --git a/lib/__pycache__/num_functions.cpython-310.pyc b/lib/__pycache__/num_functions.cpython-310.pyc deleted file mode 100644 index 07e2086353ae33f72ab56fee274c9076bccc4f60..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 277 zcmd1j<>g`kg8xQ`QcZ#MV-N=!FabFZKwQiNBvKes7+V;k7*d#m88n%bL2@tvVuP?V z5QEj$Fw`)L0o7-N)H3SyHVrs|iZR_F&5 z<);@V=H_PRr32ZC$t9V|srm&)`B|ySCGn}HIjKeZIhjfNKx5+5O7noy`FX{91(mnh tGmBj^%bY41K~4af%)?m32BiEnAvD4^2#XaccZ-IUfK3 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