Advertisement
Guest User

Untitled

a guest
May 28th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1. def CheckMystery():
  2.     global Mystery
  3.     global Quotient
  4.     global Remainder
  5.     Mystery = False
  6.     Quotient = (YYYY / 400)
  7.     Remainder = (YYYY - (400 * Quotient))
  8.     if Remainder == 0:
  9.         Mystery = False
  10.     else:
  11.         Quotient = (YYYY / 100)
  12.         Remainder = (YYYY - (100 * Quotient))
  13.         if Remainder >= 0:
  14.             Quotient = (YYYY / 4)
  15.             Remainder = (YYYY - (4 * Quotient))
  16.             if Remainder == 0:
  17.                 Mystery = False
  18.  
  19. if __name__ == "__main__":
  20.     DD = int(input("Enter day number: "))
  21.     MM = int(input("Enter month number: "))
  22.     YYYY = int(input("Enter year number: "))
  23.    
  24.     if MM == [4, 6, 9, 11]:
  25.         Last_Day = 30
  26.     elif MM == [1, 3, 5, 8, 10, 12]:
  27.         Last_Day = 31
  28.     elif MM == 2:
  29.         CheckMystery()
  30.     else:
  31.         Error_Found = True
  32.  
  33.     if Error_Found == False:
  34.         if DD < 1 or DD > Last_Day:
  35.             Error_Found = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement