-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpredict_progression_p2.py
72 lines (29 loc) · 1.91 KB
/
predict_progression_p2.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
def validate(credits):
try:
credit_value = int(input(credits))
if 0 <= credit_value <= 120 and credit_value % 20 == 0:
return credit_value
else:
print("Out of Range.")
except ValueError:
print("Integer Required.")
return validate(credits) #return function validate to tackle the continuous invalid user input.
def verification():
credit_pass = validate("Please Enter Your Credit at Pass: ")
credit_defer = validate("Please Enter Your Credit at Defer: ")
credit_fail = validate("Please Enter Your Credit at Fail: ")
Total = credit_pass + credit_defer + credit_fail
if Total != 120:
print("Total Incorrect.") #if the Total is incorrect prompt the user to input credit values back again
#from the beginning.
verification()
elif credit_pass == 120:
print("Progress.")
elif credit_pass == 100: #progression outcome 'Progress(Module Trailer)' has two unique credit
#value of '100' for 'Pass'.
print("Progress(Module Trailer).")
elif credit_pass + credit_defer >= 60:
print("Do not Progress - Module Retriever.")
else:
print("Exclude.")
verification() #finally invoke the function 'verification' to start the program.