From 858dc20bc6ad4b54507c47c080bbdfbc879376c4 Mon Sep 17 00:00:00 2001 From: steven-y-e Date: Mon, 31 Jul 2023 11:52:56 -0400 Subject: [PATCH] feat(solution): problem #1 also added a gitignore line for macos file manager confs --- .gitignore | 2 ++ solutions/001/multiplesof3or5.py | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 .gitignore create mode 100644 solutions/001/multiplesof3or5.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a0090b4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# macOS +.DS_Store diff --git a/solutions/001/multiplesof3or5.py b/solutions/001/multiplesof3or5.py new file mode 100644 index 0000000..73a3e8d --- /dev/null +++ b/solutions/001/multiplesof3or5.py @@ -0,0 +1,7 @@ +sum = 0 + +for i in range(1000): + if (i % 3) == 0 or (i % 5) == 0: + sum += i + +print("The sum of all the multiples of 3 or 5 below 1000 is: %d" % (sum)) \ No newline at end of file