From 951c343603172c05eb86d73f7d8546c3018dc192 Mon Sep 17 00:00:00 2001 From: odlarcos Date: Wed, 9 Oct 2019 20:17:48 +0200 Subject: [PATCH] Python solution provided --- .DS_Store | Bin 0 -> 6148 bytes Solutions/Multiples_of_3_and_5.py | 27 +++++++++++++++++++++++++++ Solutions/input.txt | 3 +++ 3 files changed, 30 insertions(+) create mode 100644 .DS_Store create mode 100755 Solutions/Multiples_of_3_and_5.py create mode 100644 Solutions/input.txt diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..732307ab76fa064c20717eaf38d8bbc7bdad709b GIT binary patch literal 6148 zcmeHK(Q4Z;6unB*&1Q_{VURuQrO<~kl5QQ0QSh?#ArFOa9^1n^4EVNmQ zKcoGG{>lDepVOWzDP_Scdnk-ibm8h;N%u(hu`O9dB>I!2N7N!B56;-|QT)NUpS@-c z+p-E2dW@1%Qj}9M%xc-L;eS+spPf%{X+k3^=(p#mzQ&n~(aW#KEBN}QHbl&LN89w8 z2DAfwN{5sTvn9qwjS=F_$S}_hbBOle8S%6@vRCypKFZRf>~?>N#!7Sb-hI#aJ^!Kq zB|K2mu#Cz{(T~QTxV9UW2eFOcE0tZxQT!ntP4`-l->AHd(tI@5%p zCV5imaYECfC)#VZXS0pXj@)?mV&0Lnm)%}RZa(kL=f2lo>unA9506h~Kjx=rEEhfx zd>`5#SzN$50-tKyd=JNYrt)v-T`(66hfV>ffK%Z13fPs!dvN=q+z3tqr@$RkfY%2J zXACS>2KCZ`LLUKuO*Csm%s-6Gkro4sl|l5tgrNcrRoEkjFm$v_n-^HD3>rEKd-xD` zW?@e#LeGxzrA{Xi7<8pmz$vh-z>2B1c>mwN`TW03ay6%bQ{YZ1Aew`4(8n#=y|s38 vyw^(jKAes7DudS)1bQn*E^oz8;M&kGIRFM0D}!i(xgP;7gDac@|5Sl1S0Q@p literal 0 HcmV?d00001 diff --git a/Solutions/Multiples_of_3_and_5.py b/Solutions/Multiples_of_3_and_5.py new file mode 100755 index 0000000..c3ae42b --- /dev/null +++ b/Solutions/Multiples_of_3_and_5.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python + +def multiples3or5(max): + + sum = 0 + for number in range(int(max)): + if (number % 3 == 0) or (number % 5 == 0): + sum = sum + number + + return sum + +def main(): + + results = [] + f = open("input.txt","r") + if f.mode == 'r': + fl = f.readlines() + fl.pop(0) + for max in fl: + results.append( multiples3or5(max) ) + + for i in results: + print(i) + + +if __name__== "__main__": + main() \ No newline at end of file diff --git a/Solutions/input.txt b/Solutions/input.txt new file mode 100644 index 0000000..d4354fa --- /dev/null +++ b/Solutions/input.txt @@ -0,0 +1,3 @@ +2 +10 +100 \ No newline at end of file