From e2be177a3788c7161b99c329d1ca8e2b56620dd6 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sun, 3 Oct 2021 14:03:35 -0400 Subject: [PATCH] [+] A2 P3 Q2 2b3 --- assignments/a2/a2_part3.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assignments/a2/a2_part3.py b/assignments/a2/a2_part3.py index 2da788b..b990325 100644 --- a/assignments/a2/a2_part3.py +++ b/assignments/a2/a2_part3.py @@ -134,6 +134,8 @@ def is_valid(schedule: dict[str, tuple[str, str, tuple]]) -> bool: Preconditions: - schedule matches the format for a schedule described by the assignment handout. """ + sections = schedule.values() + return all(not sections_conflict(s1, s2) or (s1 == s2) for s1 in sections for s2 in sections) def possible_schedules(c1: tuple[str, str, set], c2: tuple[str, str, set]) \