From f499b8eccd25b3a023fbd0920629c64889379eb5 Mon Sep 17 00:00:00 2001 From: s45147 Date: Sat, 16 Dec 2017 20:02:01 +0100 Subject: [PATCH] task08 fixed --- labs02/task08.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/labs02/task08.py b/labs02/task08.py index 0100ab5..be4688a 100644 --- a/labs02/task08.py +++ b/labs02/task08.py @@ -9,8 +9,8 @@ przez 3 lub 5 mniejszych niż n. def sum_div35(n): suma = 0 for i in range(n): - if (i+1) < n and (i+1)%3 == 0 and (i+1)%5 == 0: - suma += (i+1) + if i%3 == 0 or i%5 == 0: + suma += i return suma