From a4151ff0a0b4bd4c7ffd3fe4dc4af0f56e6935cd Mon Sep 17 00:00:00 2001 From: s45148 Date: Sun, 19 Nov 2017 15:42:50 +0100 Subject: [PATCH] z1, z3 --- labs02/task04.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/labs02/task04.py b/labs02/task04.py index 37413f1..e02f5ee 100644 --- a/labs02/task04.py +++ b/labs02/task04.py @@ -7,8 +7,15 @@ Jeśli podany argument jest mniejszy od 1 powinna być zwracana wartość 0. """ def sum_from_one_to_n(n): - pass - + ResultList = [] + for z in + if n <1: + ResultList.append(0) + else: + SumResult = 0 + for i in range(n+1): + SumResult = SumResult + i + ResultList.append(SumResult) def tests(f): inputs = [[999], [-100]]