Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise 1 : Alarm Clock Write a function named alarm _ clock. The function has two parameters. The first parameter is an integer named day
Exercise : Alarm Clock
Write a function named alarmclock. The function has two parameters. The first parameter is an
integer named day that encodes the day of the week: Sun, Mon, Tue, Sat. The second
parameter is a boolean named vacation, and it is true when we are on vacation. The function returns
a string that indicates when the alarm will ring. On weekdays nonvacations the alarm should ring at
am ie the function should return : On weekends nonvacations and vacations weekdays
the alarm should ring at am On vacation weekends, the alarm should be off, ie the function should
return "off".
Use the Python shell to test alarmclock.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started