From 384abbe074d45fad8cedecad687032ef197d8354 Mon Sep 17 00:00:00 2001 From: s45147 Date: Sun, 19 Nov 2017 15:11:38 +0100 Subject: [PATCH] done --- labs02/task02.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/labs02/task02.py b/labs02/task02.py index a6d6321..103c752 100644 --- a/labs02/task02.py +++ b/labs02/task02.py @@ -5,8 +5,11 @@ Napisz funkcję days_in_year zwracającą liczbę dni w roku (365 albo 366). """ -def days_in_year(days): - pass +def days_in_year(years): + if (years % 4 == 0 and years % 100 != 0) or years % 400 == 0: + return 366 + else: + return 365 def tests(f): inputs = [[2015], [2012], [1900], [2400], [1977]]