0 of 6 problems solved • 0%

Exercise prompt

List Weekend Visits

Example

The calendar library numbers the days in order, starting with Monday.

from datetime import date opening = date.fromisoformat("2024-03-01") print(opening.weekday()) # 4, Friday

Saturday and Sunday have indexes 5 and 6. Look up the weekday of each date individually.

Your task

Implement weekend_visits(dates). Given valid ISO date strings, return just the Saturday and Sunday visits as their original strings. Preserve duplicates and input order.

weekend_visits(["2024-03-03", "2024-03-01"]) # ["2024-03-03"]