ユーザーが入力した文字列で 2 回以上繰り返される文字を見つけようとしています。私はこれを持っていますが、ifステートメントには入りません。
password = asDFwe23df333
s = re.compile('((\w)\2{2,})')
m = s.search(password)
if m:
print ("Password cannot contain 3 or more of the same characters in a row\n")
sys.exit(0)