Password Validation Sololearn Code Coach | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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 Answer
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