← 返回 salesforce 的题目列表Determine Whether a Date Falls on a Weekend
类型:online_judge
Given a valid date, determine whether it falls on Saturday, Sunday, or a weekday.
Implement:
def classify_day(year: int, month: int, day: int) -> str:
Return:
"Saturday" if the date is a Saturday;
"Sunday" if the date is a Sunday;
"Weekday" otherwise.
The input consists of three integers, year month day, representing a valid Gregorian-calendar date.
Example 1
Input: 2024 6 1
Output: Saturday
Example 2
Input: 2024 6 2
Output: Sunday
Example 3
Input: 2024 6 3
Output: Weekday
Constraints
1 <= year <= 9999
1 <= month <= 12
The input date is guaranteed to be valid.
Example
Input
2024 6 1
Output
Saturday