From a4c07e0d399316efdc01f3303017a150bf211401 Mon Sep 17 00:00:00 2001 From: s45167 Date: Sun, 19 Nov 2017 15:46:50 +0100 Subject: [PATCH] update test task Signed-off-by: s45167 --- labs02/task04.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/labs02/task04.py b/labs02/task04.py index 37413f1..2a9c52b 100644 --- a/labs02/task04.py +++ b/labs02/task04.py @@ -7,7 +7,17 @@ Jeśli podany argument jest mniejszy od 1 powinna być zwracana wartość 0. """ def sum_from_one_to_n(n): - pass + xN=range(1,n+1) + xSum = 0 + if n<1: + xSum=0 + else: + for i in xN: + xSum += i + + return xSum + +#pass def tests(f):