In models/members.py
Define a class, Member, with its __init__(self, name: str, available_hours: set) method, which sets members name and available_hours attributes.
In models/members.py
Define Member's is_available_at(self, hour) method that returns True if member is available at the given hour. Return False otherwise.
In models/group_availabilities.py
Define a class, GroupAvailability, that receives a list of Member objects and sets its members attribute.
In models/group_availabilities.py
Define GroupAvailability's common_times(self) method, that returns a set of hours when all members are available.
In models/group_availabilities.py
Add a method available_at(self, hour) to GroupAvailability that returns a set of names of members who are available at the given hour.
In models/group_availabilities.py
Add a method least_available(self) to GroupAvailability that returns a list of member names who have the fewest available hours.
In models/group_availabilities.py
Add a method best_hour(self) to GroupAvailability that returns the hour at which the greatest number of members are available. If multiple hours tie, return the earliest hour.
In report.py
Create a class AvailabilityReport that receives a GroupAvailability instance and assigns it to group attribute.
In report.py
Create a AvailabilityReport method, print_report(self), that prints:
- The hours when all members are available
- The members available at 10am
- The least available members
- The best suggested hour
Example:
Common time slots for all members: 10, 14
Members available at 10am: 'Alice', 'Bob', 'Dan'
Least available members: 'Dan'
Best suggested hour for activity: 10