Exercise 1 solution from datetime import date born = date(1990, 5, 17) today = date(2026, 11, 2) # Subtract one year if this year's birthday has not happened yet. # Tuples compare month first, then day. age = today.year - born.year - ((today.month, today.day) < (born.month, born.day)) print(age) # 36 print((today - born).days) # 13318 (Both lines were run and printed exactly the values shown.) Explanation: the year difference alone (36) is only right when the birthday has already passed this year. Comparing the (month, day) tuples answers that question in one expression. Subtracting two dates gives a timedelta, whose .days attribute is the total number of days between them. Dividing that by 365 would be wrong because of leap years, which is why the birthday test is done on the calendar fields instead.