1class LockPicker_7MI0600322:
2
3 def __init__(self, lock):
4 self.lock = lock
5
6 def unlock(self):
7 args = []
8 picked = False
9
10 while not picked:
11 try:
12 self.lock.pick(*args)
13 picked = True
14 except TypeError as ex:
15 position = getattr(ex, 'position')
16 expected = getattr(ex, 'expected')
17 if not position:
18 args = [None] * expected
19 else:
20 args[position - 1] = expected()
21 except ValueError as ex:
22 position = getattr(ex, 'position')
23 expected = getattr(ex, 'expected')
24 args[position - 1] = expected
Резултат от контролното:
21/25 верни отговора.
18 точки.
.
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK
13.11.2024 12:03
13.11.2024 12:04
13.11.2024 12:05