Python Practice › Datetime Programs › Program 7
Day of the week for a date
Write a Python program to find the weekday of a date.
Input
2026-01-26
Output
0 1 Monday
Approach
weekday()(Monday = 0) or%A.
Solution
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.