From f64e91b82fb183fcce51947d27575803b9950efe Mon Sep 17 00:00:00 2001 From: s407531 Date: Sun, 13 May 2018 09:30:38 +0200 Subject: [PATCH] rozwiazanie zad 1 --- labs02/task01.py | 4 +++- labs02/task02.py | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/labs02/task01.py b/labs02/task01.py index 7c08c56..8065833 100644 --- a/labs02/task01.py +++ b/labs02/task01.py @@ -7,7 +7,9 @@ która zawiera tylko elementy z list o parzystych indeksach. """ def even_elements(lista): - pass + + moja_lista = lista[::2] + return moja_lista def tests(f): diff --git a/labs02/task02.py b/labs02/task02.py index a6d6321..2bcf28b 100644 --- a/labs02/task02.py +++ b/labs02/task02.py @@ -6,7 +6,12 @@ """ def days_in_year(days): - pass + if ((days % 4) == 0 and ((days % 100) != 0)) or ((days % 400) == 0): + dni=366 + else: + dni=365 + + return dni def tests(f): inputs = [[2015], [2012], [1900], [2400], [1977]]