Password Validation Sololearn Code Coach | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
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?

9th May 2021, 1:17 AM
Nafi Rahat Rahman
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.
9th May 2021, 2:44 AM
ä½ ēŸ„é“č¦å‰‡ļ¼Œęˆ‘也ę˜Æ
ä½ ēŸ„é“č¦å‰‡ļ¼Œęˆ‘也ę˜Æ - avatar