Sobes.tech
Junior — Senior

Implementation of a custom date class

livecode

Task condition

It is necessary to create a class MyDate that provides the following functionality:

  • construct an object by passing the year, month, and day, for example, MyDate(2024, 7, 12);
  • get the "current" date via the static method MyDate.today() (fixed as 2024-07-12 in the task);
  • compare two MyDate instances for equality using the == operator.
date_a = MyDate(2024, 7, 12)
date_b = MyDate.today()

assert date_a == date_b  # True