Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. def isValidDate(date):
  2. year = getYear(date)
  3. month = getMonth(date)
  4. day = getDay(date)
  5. if(year < 1752):
  6. print("year1\n")
  7. return False
  8. if(year > 2018):
  9. print(year)
  10. print("\n")
  11. print("year\n")
  12. return False
  13. if(day > 31):
  14. print("day\n")
  15. return False
  16. if(day < 1):
  17. print("day\n")
  18. return False
  19. if(month < 1):
  20. print("month\n")
  21. return False
  22. if(month > 12):
  23. print("month\n")
  24. return False
  25. if(month == 4 or month == 6 or month == 9):
  26. if (day > 30):
  27. return False
  28. if(month == 2):
  29. if(isLeap(date)):
  30. if (day > 29):
  31. return False
  32.  
  33. else:
  34. if(day > 28):
  35. return False
  36. if(year == 2018):
  37. if(month == 1):
  38. if(day > 18):
  39. return False
  40. if(year == 1752):
  41. if(month == 9):
  42. if(day < 14):
  43. return False
  44.  
  45. else:
  46. return True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement