Day of the week for a date

EasyDatetime Programs · 7 of 20

Write a Python program to find the weekday of a date.

Advertisement
Input
2026-01-26
Output
0 1 Monday

Approach

  1. weekday() (Monday = 0) or %A.

Solution

Python
from datetime import date d = date(2026, 1, 26)print(d.weekday(), d.isoweekday(), d.strftime("%A"))
Output
0 1 Monday

Learn the concept

New to this topic? Read the lesson, then come back.

More datetime programs

← All 20 Datetime Programs

Leave a Comment