From e1503bdbe6e9f30669f921a67808ade800dacde6 Mon Sep 17 00:00:00 2001 From: s45167 Date: Sun, 19 Nov 2017 15:13:06 +0100 Subject: [PATCH] =?UTF-8?q?Moje=20rozwi=C4=85zanie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: s45167 --- labs02/task02.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/labs02/task02.py b/labs02/task02.py index a6d6321..d8249f1 100644 --- a/labs02/task02.py +++ b/labs02/task02.py @@ -5,8 +5,18 @@ Napisz funkcję days_in_year zwracającą liczbę dni w roku (365 albo 366). """ -def days_in_year(days): - pass +#moje rozwiązanie + +def days_in_year(year): + if year%4==0 and year%100!=0: + return 366 + elif year%400==0: + return 366 + else: + return 365 + + + #pass def tests(f): inputs = [[2015], [2012], [1900], [2400], [1977]]