+ 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
2 Respuestas
+ 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...
+ 1
Your regex requires the numbers be consectuive and the symbols be consecutive which is not required in the description.