diff --git a/lib/__pycache__/num_functions.cpython-310.pyc b/lib/__pycache__/num_functions.cpython-310.pyc new file mode 100644 index 0000000..07e2086 Binary files /dev/null and b/lib/__pycache__/num_functions.cpython-310.pyc differ 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)