forked from LKnopf/Python_precourse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnils_assignment_1.py
99 lines (75 loc) · 1.75 KB
/
nils_assignment_1.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
solution_student = [] # in this list your answers are stored
# Assignment 00:
# x = 1
# y = 1
# x == y ?? True or False ?
solution_student.append(True) # the answer will be appended to the list
# Assignment 01:
# x = [1,2]
# y = [1,2]
# x == y ?? True or False ?
solution_student.append(True)
# Assignment 02:
# x = [1,2]
# y = [1,2]
# x is y ?? True or False ?
solution_student.append(False)
# Assignment 03:
# x = [1,2]
# y = x
# x == y ?? True or False ?
solution_student.append(True)
# Assignment 04:
# x = [1,2]
# y = x
# x is y ?? True or False ?
solution_student.append(True)
# Assignment 05:
# x = 5
# y = 5
# x is y ?? True or False ?
solution_student.append(True)
# Assignment 06:
# x = 5
# y = x
# x = 6
# x == y ?? True or False ?
solution_student.append(False)
# Assignment 07:
# x = 5
# y = x
# x = 6
# x is y ?? True or False ?
solution_student.append(False)
# Assignment 08:
# x = 2
# y = x
# x = x + 1
# x == y ?? True or False ?
solution_student.append(False)
# Assignment 09:
# x = [1,2]
# y = x
# x.append(3)
# x is y ?? True or False ?
solution_student.append(True)
# Assignment 10:
# x = [1,2]
# y = x
# x.append(3)
# x == y ?? True or False ?
solution_student.append(True)
if __name__ == '__main__':
import _pickle
with open('./solutions/solution_1.pkl', 'rb') as solution_file:
solution_tutors = _pickle.load(solution_file)
if solution_tutors == solution_student:
print('Solved!')
else:
false_answers = []
for index, answer in enumerate(solution_student):
if answer != solution_tutors[index]:
false_answers.append(str(index))
else:
pass
print('Try Again! Answer(s) for the assignment(s) {} are wrong'.format(', '.join(false_answers)))