Format a Date for Humans

Easy ⏱ 8 min 78% acceptance ★★★★★ 4.6
Write friendly(d) that formats a date object as 'Tuesday, 28 July 2026' using strftime codes — weekday name, day without leading zero is OS-dependent, so use %d and strip a leading zero manually for portability.

Examples

Example 1
Input
friendly(date(2026, 7, 28))
Output
'Tuesday, 28 July 2026'
Explanation

%A, %d %B %Y produces the layout; the leading zero is stripped.

Constraints

  • Use strftime.
  • No leading zero on the day.

Topics

Date & Timestrftime

Companies

ZomatoMakeMyTrip

Hints

Hint 1

d.strftime('%A, %d %B %Y').

Hint 2

lstrip('0') on the day part, or replace(' 0', ' ').

Loading the Python runtime… Run executes your code and shows printed output; Submit checks your function against this problem's examples.