-
Notifications
You must be signed in to change notification settings - Fork 111
/
Copy pathhandbook.py
41 lines (26 loc) · 1.2 KB
/
handbook.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""
Inside conditions.json, you will see a subset of UNSW courses mapped to their
corresponding text conditions. We have slightly modified the text conditions
to make them simpler compared to their original versions.
Your task is to complete the is_unlocked function which helps students determine
if their course can be taken or not.
We will run our hidden tests on your submission and look at your success rate.
We will only test for courses inside conditions.json. We will also look over the
code by eye.
NOTE: We do not expect you to come up with a perfect solution. We are more interested
in how you would approach a problem like this.
"""
import json
# NOTE: DO NOT EDIT conditions.json
with open("./conditions.json") as f:
CONDITIONS = json.load(f)
f.close()
def is_unlocked(courses_list, target_course):
"""Given a list of course codes a student has taken, return true if the target_course
can be unlocked by them.
You do not have to do any error checking on the inputs and can assume that
the target_course always exists inside conditions.json
You can assume all courses are worth 6 units of credit
"""
# TODO: COMPLETE THIS FUNCTION!!!
return True