Finish get_valid_courses

This commit is contained in:
MstrPikachu
2021-10-03 16:05:00 -04:00
parent 2c5ce4a229
commit 3bdcc7e36d
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -248,6 +248,7 @@ def is_section_compatible(schedule: dict[str, tuple[str, str, tuple]],
- section matches the format for a section described by the assignment handout. - section matches the format for a section described by the assignment handout.
- schedule matches the format for a schedule described by the assignment handout. - schedule matches the format for a schedule described by the assignment handout.
""" """
return [not sections_conflict(section, s) for s in schedule.values]
def is_course_compatible(schedule: dict[str, tuple[str, str, tuple]], def is_course_compatible(schedule: dict[str, tuple[str, str, tuple]],
+3 -1
View File
@@ -124,7 +124,9 @@ def get_valid_schedules(course_data: dict[str, tuple[str, str, set]],
2. You'll need to process each course to filter to keep only the sections 2. You'll need to process each course to filter to keep only the sections
that appear in the given term. See the function we've started for you below. that appear in the given term. See the function we've started for you below.
""" """
# TODO valid_courses = [course_data[code] for code in course_data if code in courses]
a, b, c, d, e = [filter_by_term(course, term) for course in valid_courses]
return a2_part3.valid_five_course_schedules(a, b, c, d, e)
def filter_by_term(course: tuple[str, str, set], term: str) -> tuple[str, str, set]: def filter_by_term(course: tuple[str, str, set], term: str) -> tuple[str, str, set]: