From 7cab28e19464ee308f68f2e10ddec80740b59d3f Mon Sep 17 00:00:00 2001 From: puderniczka Date: Sat, 2 Jun 2018 21:48:37 +0200 Subject: [PATCH] task01, task02 done --- labs02/task01.py | 5 +++-- labs02/task02.py | 11 ++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/labs02/task01.py b/labs02/task01.py index 5ff526e..5f3d85c 100644 --- a/labs02/task01.py +++ b/labs02/task01.py @@ -7,8 +7,9 @@ która zawiera tylko elementy z list o parzystych indeksach. """ def even_elements(lista): - print(lista[::2]) - pass + #print(lista[::2]) + return lista[::2] + def tests(f): diff --git a/labs02/task02.py b/labs02/task02.py index a6d6321..f61493c 100644 --- a/labs02/task02.py +++ b/labs02/task02.py @@ -6,7 +6,16 @@ """ def days_in_year(days): - pass + if days % 400 == 0: + return 366 + elif days % 100 == 0: + return 365 + elif days % 4 == 0: + return 366 + else: + return 365 + + def tests(f): inputs = [[2015], [2012], [1900], [2400], [1977]]