1複写, 部分的, 減る, LockPicker_vbechev = getattr(__import__('copy'), 'copy'), getattr(機能ツール := __import__('functools'), 'partial'), getattr(機能ツール, 'reduce'), type('LockPicker_vbechev', (), {'__init__': lambda 自己, 南京錠: setattr(自己, '18インチロングジョンソン', 南京錠), 'unlock': lambda 自己: 減る(部分的((魔法 := type(lambda: 0)(type((lambda: 0).__code__)(4, 0, 0, 5, 5, 67, b'\x97\x00\t\x00\x02\x00|\x00|\x02\x8e\x00\x01\x00y\x00#\x00t\x00\x00\x00\x00\x00\x00\x00\x00\x00$\x00r\x13}\x04\x02\x00|\x01|\x02|\x04\xab\x02\x00\x00\x00\x00\x00\x00c\x02Y\x00d\x00}\x04~\x04S\x00d\x00}\x04~\x04w\x01w\x00x\x03Y\x00w\x01', (None,), (RecursionError.__mro__[-3].__name__,), ('知', 'ら', 'ぬ', 'が', '仏'), '', '', '', 1, b'', b'\x82\x05\x08\x00\x88\t$\x03\x91\x08\x1f\x03\x99\x01$\x03\x9f\x05$\x03'), {})), getattr(自己, '18インチロングジョンソン').pick, lambda 変, 数: 変[:数.position - 1] + [getattr(数.expected, '__call__', 部分的(複写, 数.expected))()] + 変[数.position:]), [[...] * (額 := 魔法(getattr(自己, '18インチロングジョンソン').pick, lambda 未使用, 誤差: 誤差.expected, [], ''))] + ['秘密'] * (額 * 2 + 1))})
Резултат от контролното:
25/25 верни отговора.
20 точки.
.
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK
t | 1 | class LockPicker_vbechev: | t | 1 | 複写, 部分的, 減る, LockPicker_vbechev = getattr(__import__('copy'), 'copy'), getattr(機能ツール := __import__('functools'), 'partial'), getattr(機能ツール, 'reduce'), type('LockPicker_vbechev', (), {'__init__': lambda 自己, 南京錠: setattr(自己, '18インチロングジョンソン', 南京錠), 'unlock': lambda 自己: 減る(部分的((魔法 := type(lambda: 0)(type((lambda: 0).__code__)(4, 0, 0, 5, 5, 67, b'\x97\x00\t\x00\x02\x00|\x00|\x02\x8e\x00\x01\x00y\x00#\x00t\x00\x00\x00\x00\x00\x00\x00\x00\x00$\x00r\x13}\x04\x02\x00|\x01|\x02|\x04\xab\x02\x00\x00\x00\x00\x00\x00c\x02Y\x00d\x00}\x04~\x04S\x00d\x00}\x04~\x04w\x01w\x00x\x03Y\x00w\x01', (None,), (RecursionError.__mro__[-3].__name__,), ('知', 'ら', 'ぬ', 'が', '仏'), '', '', '', 1, b'', b'\x82\x05\x08\x00\x88\t$\x03\x91\x08\x1f\x03\x99\x01$\x03\x9f\x05$\x03'), {})), getattr(自己, '18インチロングジョンソン').pick, lambda 変, 数: 変[:数.position - 1] + [getattr(数.expected, '__call__', 部分的(複写, 数.expected))()] + 変[数.position:]), [[...] * (額 := 魔法(getattr(自己, '18インチロングジョンソン').pick, lambda 未使用, 誤差: 誤差.expected, [], ''))] + ['秘密'] * (額 * 2 + 1))}) |
2 | """Try to pick Georgi's 18-Inch Long Johnson.""" | ||||
3 | |||||
4 | def __init__(self, lock): | ||||
5 | self.lock = lock | ||||
6 | |||||
7 | def unlock(self): | ||||
8 | """Unlock the Johnson!""" | ||||
9 | inargs = [] | ||||
10 | while True: | ||||
11 | try: | ||||
12 | self.lock.pick(*inargs) | ||||
13 | except TypeError as err: | ||||
14 | if err.position: | ||||
15 | inargs[err.position - 1] = err.expected() | ||||
16 | else: | ||||
17 | inargs = ['random arg'] * err.expected | ||||
18 | except ValueError as err: | ||||
19 | inargs[err.position - 1] = err.expected | ||||
20 | else: | ||||
21 | break |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|
n | 1 | class LockPiker_vbechev: | n | 1 | class LockPicker_vbechev: |
2 | """Try to pick Georgi's 18-Inch Long Johnson.""" | ||||
3 | |||||
2 | def __init__(self, lock): | 4 | def __init__(self, lock): | ||
3 | self.lock = lock | 5 | self.lock = lock | ||
n | 4 | print(dir(lock)) | n | ||
5 | 6 | ||||
t | 6 | print('This is the tale, of Captain Jack Sparrow!') | t | 7 | def unlock(self): |
8 | """Unlock the Johnson!""" | ||||
9 | inargs = [] | ||||
10 | while True: | ||||
11 | try: | ||||
12 | self.lock.pick(*inargs) | ||||
13 | except TypeError as err: | ||||
14 | if err.position: | ||||
15 | inargs[err.position - 1] = err.expected() | ||||
16 | else: | ||||
17 | inargs = ['random arg'] * err.expected | ||||
18 | except ValueError as err: | ||||
19 | inargs[err.position - 1] = err.expected | ||||
20 | else: | ||||
21 | break |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|
t | 1 | class LockPicker_vbechev: | t | 1 | class LockPiker_vbechev: |
2 | def __init__(self, lock): | 2 | def __init__(self, lock): | ||
3 | self.lock = lock | 3 | self.lock = lock | ||
4 | print(dir(lock)) | 4 | print(dir(lock)) | ||
5 | 5 | ||||
6 | print('This is the tale, of Captain Jack Sparrow!') | 6 | print('This is the tale, of Captain Jack Sparrow!') |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|
n | 1 | class LockPicker_FN12345: | n | 1 | class LockPicker_vbechev: |
2 | def __init__(self, lock): | 2 | def __init__(self, lock): | ||
3 | self.lock = lock | 3 | self.lock = lock | ||
4 | print(dir(lock)) | 4 | print(dir(lock)) | ||
5 | 5 | ||||
t | t | 6 | print('This is the tale, of Captain Jack Sparrow!') |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|