Count business days

Mediumdatetimetimedeltaweekday· 20 XP

A support team promises to answer within a number of business days (Monday to Friday). The SLA report counts the business days from the day a ticket opened to the day it was answered.

Write a function business_days(start, end) that takes two dates as "YYYY-MM-DD" strings and returns how many Mondays to Fridays fall between them, including both ends. If end is before start, return 0.

How it's checked

Your code runs, then the check below runs and its printed output is compared with ours.

  • business_days("2026-03-02", "2026-03-08") returns 5 (Monday to Sunday)

Hints, the later steps and the answer come with Pro.

from datetime import date, timedelta

def business_days(start, end):
    ...