Question: https://www.chegg.com/homework-help/questions-and-answers/class-workoutclass-workout-class-offered-gym-private-attributes-name-name-workoutclass-req-q44040301 For this question, I need offerings_at function implementation using create_offering_dict. def offerings_at(self, time_point: datetime) -> list[dict[str, str | int]]: Return a list of dictionaries,

https://www.chegg.com/homework-help/questions-and-answers/class-workoutclass-workout-class-offered-gym-private-attributes-name-name-workoutclass-req-q44040301

For this question, I need offerings_at function implementation using create_offering_dict.

https://www.chegg.com/homework-help/questions-and-answers/class-workoutclass-workout-class-offered-gym-private-attributes-name-name-workoutclass-req-q44040301 For this question, I need offerings_at function implementation using create_offering_dict. def

def offerings_at(self, time_point: datetime) -> list[dict[str, str | int]]: """Return a list of dictionaries, each representing a workout offered at this Gym at .

The offerings should be sorted by room name, in alphabetical ascending order.

Each dictionary must have the following keys and values: 'Date': the weekday and date of the class as a string, in the format 'Weekday, year-month-day' (e.g., 'Monday, 2022-11-07') 'Time': the time of the class, in the format 'HH:MM' where HH uses 24-hour time (e.g., '15:00') 'Class': the name of the class 'Room': the name of the room 'Registered': the number of people already registered for the class 'Available': the number of spots still available in the class 'Instructor': the name of the instructor If there are multiple instructors with the same name, the name should be followed by the instructor ID in parentheses e.g., "Diane (1)"

If there are no offerings at , return an empty list.

NOTE: - You MUST use the helper function create_offering_dict from gym_utilities to create the dictionaries, in order to make sure you match the format specified above. - You MUST use the helper method _is_instructor_name_unique when deciding how to format the instructor name.

>>> ac = Gym('Athletic Centre') >>> diane1 = Instructor(1, 'Diane') >>> diane1.add_certificate('Cardio 1') True >>> diane2 = Instructor(2, 'Diane') >>> david = Instructor(3, 'David') >>> david.add_certificate('Strength Training') True >>> ac.add_instructor(diane1) True >>> ac.add_instructor(diane2) True >>> ac.add_instructor(david) True >>> ac.add_room('Dance Studio', 50) True >>> ac.add_room('Room A', 20) True >>> boot_camp = WorkoutClass('Boot Camp', ['Cardio 1']) >>> ac.add_workout_class(boot_camp) True >>> kickboxing = WorkoutClass('KickBoxing', ['Strength Training']) >>> ac.add_workout_class(kickboxing) True >>> t1 = datetime(2022, 9, 9, 12, 0) >>> ac.schedule_workout_class(t1, 'Dance Studio', boot_camp.name, 1) True >>> ac.schedule_workout_class(t1, 'Room A', kickboxing.name, 3) True >>> ac.offerings_at(t1) == [ ... { 'Date': 'Friday, 2022-09-09', 'Time': '12:00', ... 'Class': 'Boot Camp', 'Room': 'Dance Studio', 'Registered': 0, ... 'Available': 50, 'Instructor': 'Diane (1)' }, ... { 'Date': 'Friday, 2022-09-09', 'Time': '12:00', ... 'Class': 'KickBoxing', 'Room': 'Room A', 'Registered': 0, ... 'Available': 20, 'Instructor': 'David' } ... ] True """

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!