(Code coach) Password validation. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

(Code coach) Password validation.

Please let me know what is wrong with my code. Why test no. 13 showing an error? https://code.sololearn.com/c3muh4Yhkn10/?ref=app

19th Jul 2020, 5:54 PM
Asmit joy
Asmit joy - avatar
2 Answers
+ 4
I found another way, import re pswd = input() special = re.sub ("[!@#$%&*]", "", pswd) nums = re.sub ("[\d]", "", pswd) if len(pswd) < 7 or len(special) == len(pswd) or len(nums) == len(pswd): print ("Weak") else : print ("Strong") but plz let me know what is wrong with the the above code...
19th Jul 2020, 5:57 PM
Asmit joy
Asmit joy - avatar
+ 1
Your regex requires the numbers be consectuive and the symbols be consecutive which is not required in the description.
19th Jul 2020, 5:58 PM
Russ
Russ - avatar