Exercise 3 solution from datetime import datetime dt = datetime(2026, 3, 5, 9, 7, 4) line = dt.strftime("%a %d %b %Y, week %V, day %j") print(line) # Check: parse the date part back and compare date_part = line.split(",")[0] back = datetime.strptime(date_part, "%a %d %b %Y") print(back.date() == dt.date()) Output (run, and exactly as shown): Thu 05 Mar 2026, week 10, day 064 True Explanation: literal text in a format string is copied through unchanged, so ", week " and ", day " need no escaping; only the percent codes are replaced. %V is the ISO week number and %j the day of the year. The check splits at the first comma and parses the left part with the matching format. Note that the weekday name in the text is read by strptime but does not change which date it is: the day, month and year decide that. Names depend on the locale, so this exact output assumes an English locale.