Objective
Create a Python program that counts the working days (Monday to Friday) between two dates, both included, going through the days one by one with timedelta(days=1).
Instructions
- Read an integer
nand thennlines with two datesYYYY-MM-DDseparated by a space (the second is equal to or later than the first). - Start at the first date and move forward one day at a time while you do not go past the second. Count the days whose
weekday()is less than 5 (Monday to Friday). There are no holidays. - Show
Working days: dfor each line.
2
2026-11-09 2026-11-13
2026-11-09 2026-11-22
Working days: 5
Working days: 10
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise