0
Password Validation Sololearn Code Coach
import re p= input(" ") x= True while x: if (len(p)<7): break elif not re.search("([0-9]{2})",p): break elif not re.search("([!%*$#@]{2})",p): break else: print("Strong") x=False break if x: print("Weak") """ I didn’t pass test-10, test -11, But Why? Where is the problem?
1 Resposta
0
Missing one special character to match '*'.
Even with that, your code prints "Weak" with input "#3@1Carrie". The problem is that your code doesn't match special characters or numbers that appear separately.
Example: re.search("[0-9]{2}", "3h3") is False, while it is satisfied according yo the question.