tools.py 244 B

12345678910
  1. def get_max_day(year: int, month: int):
  2. result = 30
  3. if month in (1, 3, 5, 7, 8, 10, 12):
  4. result = 31
  5. elif month == 2:
  6. if year % 4 == 0:
  7. result = 29
  8. else:
  9. result = 28
  10. return result