FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Basic-Programs-Python/Programs/leap_year_checker.py at master · chicode-dev/Basic-Programs-Python · GitHub
chicode-dev
/
Basic-Programs-Python
Public
forked from
Akshu-on-github/Basic-Programs-Python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Basic-Programs-Python
/
Programs
/
leap_year_checker.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (20 loc) · 911 Bytes
Breadcrumbs
Basic-Programs-Python
/
Programs
/
leap_year_checker.py
Copy path
File metadata and controls
27 lines (20 loc) · 911 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'''
Author: Abdurahman Ali Mohammed
Leap years are years where an extra, or intercalary, day is added to the end of the shortest month, February.
The intercalary day, February 29, is commonly referred to as leap day.
Leap years have 366 days instead of the usual 365 days and occur almost every four years.
'''
def
isLeapYear
(
year
):
if
(
year
%
4
)
==
0
:
#check if year is divisible by 4
if
(
year
%
100
)
==
0
:
#check if it is divisible by 100
if
(
year
%
400
)
==
0
:
#check if it is divisible by 400
print
(
"{0} is a leap year"
.
format
(
year
))
else
:
print
(
"{0} is not a leap year"
.
format
(
year
))
else
:
print
(
"{0} is a leap year"
.
format
(
year
))
else
:
print
(
"{0} is not a leap year"
.
format
(
year
))
# take an input and pass it to the method
y
=
input
(
'Enter the year you want to check:'
)
ans
=
isLeapYear
(
int
(
y
))
Back
|
FazBrowse Home
|
New Git URL