1class LockPicker_9MI0600340:
2 def __init__(self, lock):
3 self.lock = lock
4
5 def unlock(self):
6 args = []
7 while True:
8 try:
9 if self.lock.pick(*args):
10 return
11 except Exception as curr_ex:
12 if isinstance(curr_ex, TypeError):
13 if curr_ex.position is None:
14 args = [None] * curr_ex.expected
15 else:
16 args[curr_ex.position - 1] = curr_ex.expected()
17 elif isinstance(curr_ex, ValueError):
18 args[curr_ex.position - 1] = curr_ex.expected
19 else:
20 raise
Резултат от контролното:
16/25 верни отговора.
13 точки.
.
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK
13.11.2024 15:55