forked from tdwojak/Python2017
Moje rozwiązanie
Signed-off-by: s45167 <krzysztof.spalinski@op.pl>
This commit is contained in:
parent
39fbf2eb06
commit
e1503bdbe6
@ -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]]
|
||||
|
Loading…
Reference in New Issue
Block a user