easyUnit 4 · Control Flow: if-elif-else, match-case
P11. Day of the Week
Control Flow: if-elif-else, match-case
Read a day number from 1 (Monday) to 7 (Sunday). Use match-case to print the day's name. Use a combined pattern case 6 | 7 (or similar) to decide whether it is a weekday or the weekend.
Input Format
- Line 1:
day; an integer
Output Format
- Line 1: the day name, e.g.
Monday - Line 2:
WeekdayorWeekend - If the number is not 1 to 7, print only one line:
Invalid day
Constraints
- -100 ≤
day≤ 100
Sample Test Cases
Sample 1
Input
3
Output
Wednesday Weekday
Sample 2
Input
7
Output
Sunday Weekend
Submitting checks 2 sample cases and 5 hidden test cases.