Question: Question 1 : Are you available to meet? Write code that, for a given day and time, sets result to True if you are available

Question 1: Are you available to meet?
Write code that, for a given day and time, sets result to True if you are available to meet on that day and time, and False if you are not. Your calendar is provided in a dictionary called calendar. The keys in this dictionary are your work days: Monday through Friday. The value for each key is the interval of time when you are available to begin a meeting. So, for example, calendar['Monday']=[8,12] means that you are available to start a one-hour meeting on Mondays any time between 8am and 12 noon (inclusive), and not outside of those hours.
The cell below has some starter code for you to work with. Once you are satisfied with your code, you can copy-paste it into the autograded function called available in the following cell.
Note:
We are using a 24-hour clock format, so 15 corresponds to 3 p.m.
Your code should return False if the provided key is not in the calendar dictionary.
Hint: You can check whether the provided day is a key in the dictionary with calendar.keys() and the membership operator in.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!