date objects, write weekday_histogram(dates) returning a dict mapping weekday names ('Monday'…) to counts, including only weekdays that appear. strftime('%A') names the day.weekday_histogram([date(2026, 7, 27), date(2026, 7, 27), date(2026, 7, 28)])
{'Monday': 2, 'Tuesday': 1}Two Mondays and one Tuesday.
d.strftime('%A') or a names list indexed by weekday().
dict.get(k, 0) + 1 accumulates.