Hi,
In Code-block 1
It will return True only for case when both have same DoB and for rest of two cases (before and after) it will return False.
In Code-block 2
It will return False when DoBs are not same which can be of two cases (before and after) and otherwise it will return True which means for same DoB.
So when we see the return value for both code-blocks they actually have same result but using different implementation.
I hope you will understand the above explanation if not please write us again.
Regards,
Deepak
IITM Online Degree Team