Ctrl K

Weekday of a Date

Easy
A date is given as three integers: day is the day of the month, month is the month number, and year is the year (Gregorian calendar). Return the day of the week that date falls on, as one of the strings "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday". A reference point if you need one: 1 January 1971 was a Friday.
Example 1
day=1, month=1, year=2000 → 'Saturday'

1 January 2000 was a Saturday.

Example 2
day=29, month=2, year=2024 → 'Thursday'

2024 is a leap year, so 29 February exists, and it was a Thursday.

Constraints
  • The date exists and lies between the years 1971 and 2100 inclusive
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsA Number That Reads Both Ways EasyValue of a Roman Numeral EasyAdd One to a Digit Array EasySum of Binary Strings EasyWhole Square Root Easy
loading Python…
Input
day=1, month=1, year=2000
Expected
'Saturday'

Run checks the first 3 tests in your browser. Submit checks all 20 tests on the server, hidden ones included.