import time
from itertools import product
target = 'pass'
chars = 'abcdefghijklmnopqrstuvwxyz'
def check(chars, repeat):
pws = product(chars, repeat=repeat)
for pw in pws: if ''.join(pw) == target: return ''.join(pw)
start = time.time()
pw = check(chars, 4)
if (pw is None):
print('failure')
else:
print('got it! -->', pw)
finish = time.time() - start
print(finish, ' sec');
上のコードを順に説明していただきたいです。初心者ですのでできれば丁寧に。引用テキスト
回答1件
あなたの回答
tips
プレビュー