Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. def checkLeapYear(year):
  2. if (year % 4 != 0): #if (year is not divisible by 4) then (it is a common year)
  3. return False
  4. elif (year % 100 != 0): #else if (year is not divisible by 100) then (it is a leap year)
  5. return True
  6. elif (year % 400 != 0): #else if (year is not divisible by 400) then (it is a common year)
  7. return False
  8. else: #else (it is a leap year)
  9. return True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement