From 78c7f917d1f0e7ab70751623d8c0b7dbf8e1ab83 Mon Sep 17 00:00:00 2001 From: t3xhno Date: Tue, 6 Feb 2024 14:25:34 +0100 Subject: [PATCH] Dir structure --- lib/__pycache__/num_functions.cpython-310.pyc | Bin 0 -> 277 bytes lib/num_functions.py | 2 ++ problem1.py | 6 ------ src/problem1.py | 10 ++++++++++ 4 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 lib/__pycache__/num_functions.cpython-310.pyc create mode 100644 lib/num_functions.py delete mode 100755 problem1.py create mode 100755 src/problem1.py diff --git a/lib/__pycache__/num_functions.cpython-310.pyc b/lib/__pycache__/num_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..07e2086353ae33f72ab56fee274c9076bccc4f60 GIT binary patch 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 literal 0 HcmV?d00001 diff --git a/lib/num_functions.py b/lib/num_functions.py new file mode 100644 index 0000000..3cc0f90 --- /dev/null +++ b/lib/num_functions.py @@ -0,0 +1,2 @@ +def isDivBy(num, denom): + return num % denom == 0 diff --git a/problem1.py b/problem1.py deleted file mode 100755 index b929f79..0000000 --- a/problem1.py +++ /dev/null @@ -1,6 +0,0 @@ -sum = 0 - -for i in range(1, 1000): - if i % 3 == 0 or i % 5 == 0: sum += i - -print(sum) diff --git a/src/problem1.py b/src/problem1.py new file mode 100755 index 0000000..feeea44 --- /dev/null +++ b/src/problem1.py @@ -0,0 +1,10 @@ +import sys +sys.path.append("lib") +from num_functions import isDivBy + +sum = 0 + +for i in range(1, 1000): + if isDivBy(i, 3) or isDivBy(i, 5): sum += i + +print(sum)