Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
2
Task/Leap-year/Python/leap-year-1.py
Normal file
2
Task/Leap-year/Python/leap-year-1.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
import calendar
|
||||
calendar.isleap(year)
|
||||
2
Task/Leap-year/Python/leap-year-2.py
Normal file
2
Task/Leap-year/Python/leap-year-2.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
def is_leap_year(year):
|
||||
return not year % (4 if year % 100 else 400)
|
||||
8
Task/Leap-year/Python/leap-year-3.py
Normal file
8
Task/Leap-year/Python/leap-year-3.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import datetime
|
||||
|
||||
def is_leap_year(year):
|
||||
try:
|
||||
datetime.date(year, 2, 29)
|
||||
except ValueError:
|
||||
return False
|
||||
return True
|
||||
Loading…
Add table
Add a link
Reference in a new issue