0

My last case of password validator is not working.I am unable to find error...How I make correct this??

x=str(input()) if len(x)<7 or re.search(("\b"),x) or re.search(("\s"),x): print("Weak") else: p1=r"[0-9]{2,}" m1=re.search(p1,x) p3=r"[!@#

amp;*%]{2,}" m3=re.search(p3,x) if (m1 and m3): print("Strong") else: print("Weak")

22nd Nov 2020, 5:44 PM
Sid
Sid - avatar
1 Respuesta
+ 3
Sid , as you have no task description provided, we have to figure out the rules for the password. I assume that this is a code coach exercise. Conditions: length >= 7 digits 2 minimum punctuation 2 minimum But the program gives "Strong" if i input a space or a dot or comma in the password. So "12%& ,." is judged as Strong. I think the problem is that you check each of the conditions separately.
22nd Nov 2020, 7:26 PM
Lothar
Lothar - avatar