From 740202ea3f37d5991fa71af0145c2705b9ea9dfa Mon Sep 17 00:00:00 2001 From: s45148 Date: Tue, 28 Nov 2017 20:31:33 +0100 Subject: [PATCH] z1, z2, z3 --- labs02/task02.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/labs02/task02.py b/labs02/task02.py index 7f03c44..a414817 100644 --- a/labs02/task02.py +++ b/labs02/task02.py @@ -6,11 +6,13 @@ """ def days_in_year(year): - num_days =[] - for y in year: - num_days.append() - return - + if year % 4 == 0: + if year % 100 > 0 or year % 400 == 0: + return 366 + else: + return 365 + else: + return 365 def tests(f): inputs = [[2015], [2012], [1900], [2400], [1977]] outputs = [365, 366, 365, 366, 365]