Exercise 3 solution from datetime import date, timedelta holidays = {date(2026, 12, 25), date(2026, 12, 28)} def is_business(d): return d.weekday() < 5 and d not in holidays def count_business(start, end): """Business days in [start, end).""" return sum(is_business(start + timedelta(days=i)) for i in range((end - start).days)) def add_business_days(d, n): left = n while left > 0: d += timedelta(days=1) if is_business(d): left -= 1 return d print(count_business(date(2026, 12, 1), date(2027, 1, 1))) print(add_business_days(date(2026, 12, 15), 10)) print(add_business_days(date(2026, 12, 24), 1)) print(add_business_days(date(2026, 12, 26), 0)) print(count_business(date(2026, 12, 14), date(2026, 12, 14))) Output (run, and exactly as shown): 21 2026-12-31 2026-12-29 2026-12-26 0 Explanation: December 2026 has 23 weekdays; removing the two holidays that fall on weekdays (Friday 25th and Monday 28th) leaves 21. Ten business days after 15 December lands on 31 December. From 24 December, the next business day skips the 25th (holiday), the weekend and the 28th (holiday), reaching the 29th. Adding zero business days returns the date unchanged, even if it is not a business day (26 December is a Saturday), which is a choice to document. A range from a date to itself is empty, so the count is 0: the end date is excluded.