Weekday or Weekend?
Python
15 pts
Weekday or Weekend?
Days are numbered from 1 (Monday) to 7 (Sunday). Given day = 6, use match to create a variable kind:
"Weekday"for 1, 2, 3, 4 or 5 (one case with|)"Weekend"for 6 or 7 (one case with|)"Invalid day"for anything else (use_)
Then print Day 6: Weekend using the variables.
Expected output:
Day 6: Weekend
Checklist
- Use
matchondayto setkind, with one case for weekdays, one for the weekend and one for anything else. - Print the day and its kind.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
