Dates and times · 11 / 15 Exercise Medium

Format dates

Objective

Create a Python program that shows each date in two readable formats. The strftime method converts a date into text following a pattern of codes such as %d, %m and %Y.

Instructions

  • Read an integer n and then n dates in YYYY-MM-DD format.
  • Short format: %m/%d/%Y (month/day/year with zeros). Long format: March 15, 2026, with the month name capitalized, no zero on the day, and the day of the week in parentheses (lists of names, as before).
  • Show each date as 03/06/2026 - March 6, 2026 (Friday).
Input
2
2026-03-06
2026-12-25
Output
03/06/2026 - March 6, 2026 (Friday)
12/25/2026 - December 25, 2026 (Friday)

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise