From cc509761d915d893df20d13bdcf16c6916ff5204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Maliszewski?= Date: Wed, 13 Jun 2018 17:38:03 +0000 Subject: [PATCH] Zaktualizuj 'labs02/task08.py' --- labs02/task08.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/labs02/task08.py b/labs02/task08.py index 252b10d..00fea26 100644 --- a/labs02/task08.py +++ b/labs02/task08.py @@ -7,7 +7,13 @@ przez 3 lub 5 mniejszych niż n. """ def sum_div35(n): - pass + suma = 0 + for i in range(n-1): + if (i%3==0) or (i%5==0): + suma = suma + i + + return suma + def tests(f): inputs = [[10], [100], [3845]] @@ -21,4 +27,3 @@ def tests(f): if __name__ == "__main__": print(tests(sum_div35)) -